Crystal Reports Setting Global Subreport Variable - syntax

I am trying to set a couple of global variables in a subreport so that it pulls and stores the data I need in each.
Say I go into the formula workshop and create a new formula. Right now I have
Global numbervar name:= ;
I have a single table with multiple fields. I have one field named {table.order} and another named {table.amount}. Both of these are numbers. How do I assign to this variable the amount in the associated amount field when the order is -1? I'm really not familiar with crystal syntax at all.
After this, where would I need to drag and drop this formula in the report to pick up this data or is simply creating the formula in the formula explorer enough? If it needs to be physically dragged into the report, will anything show up or will I need to suppress it so it is not visible and if that is the case, will it still work suppressed?
Thanks for any help you can give.

Are you trying to pass the value in this variable back to the main report? If so, you'll need to make this a Shared Numbervar, not a Global Numbervar.
To answer your question; create this formula:
global numbervar name;
if {table.order} = -1 then name := {table.amount}
...and drop it into your subreport's details section. Note that any formulas, summaries, running totals, SQL expressions, etc. that you create but are not placed in the actual report won't be run. However, after placing it in the report, it will display. To prevent this, right click on the field, go to the 'Common' tab, and then check 'Suppress'. The formula will still work when suppressed.
One other thing to keep in mind is that if your subreport(s) contain more than one row of data, the variable will be overwritten for each.

Related

SSRS Static fields in groups

Good afternoon!
I have created a report with the wizard to create a matrix that is grouped and has drill down rows. I have added filters to the rows and columns and it works great! I then copied that matrix and modified the filters, so I had two matrixes.
But what I really wanted was those two rows in the same matrix, just in different row groups. So I added another group, using the adjacent below option, and then added all the child groupings. However, when I run the report it shows the values for the first row of the drill down data.
When I look at the groupings I can see the one I did manually has a 'Static' field in each row grouping but the ones that the wizard did (with the red ?), they don't have that "extra" row:
What do I need to change or how do I need to add my groups so that I don't get that "static" row and not show the data? I have the visibility set to 'Hidden' and the toggle set up for the prior grouping set data.
Assuming a few things....
the data comes from a single dataset
You are differentiating between Property and Violent crimes by filtering on a column, I'll call it IncidentGroup for the sake of illustration..
I've understood your question ! :)
Get to the point where you had just a single tablix filtered to show 'Property crime'.
Now remove or edit that filter so it shows all the data you need in the report.
Finally, right click on your Matrix1_IncidentCategory row and add a parent group, choose IncidentGroup (or whatever the column is actually called) and check the box to add a group header.
That should be it, there is no need for a second tablix.
Without knowing how you are filtering currently it's hard to give a complete answer but this should get you close, if not all the way there.
If this doesn't work for whatever reason, please post sample data from your dataset output and your current filters.

How to correctly bind a DDL in LibreOffice Calc

I'm trying to bind a serie of simple lists with 2 values to a DDL in LibreOffice Calc. I want the DDL show the description and that returns the relative ID in the linked cell. I currently can just partially do that, I'm unable to show the description in the DDL, as per my image:
I have other lists but the concept is the same, the list should always show the decription and return the relative ID, every list is on its own, so element in list A is not in list B as they are groupped up by type.
The following are the settings in my DDL, the marked setting is always disabled, regardless of what other setting I select. The marked setting should be "data field" and I suppose that it should allow me to specify what column in my list contains the data.
In your example, the control is not bound to any data source. So, it cannot be bound to an underlying field.
The full solution is to create a data source in LibreOffice Base and then use it as the underlying source for the form. Then it is straightforward to bind the combo box control to a field, either through a wizard or by changing the settings.
However, perhaps you want to avoid the complexity of Base. In that case, if the descriptions are unique, then use those as the source of the list, and get the IDs with a function such as VLOOKUP.
EDIT:
Here is an example of VLOOKUP in A6, where A5 is the linked cell.

Can't seem to get runningvalues to work in VS2013 Report Designer

I have a margins report that I've created that groups by Month, Customer, Sales Type then displays the sales details. I have that basic report working well. The SALTYPE group has four options from the stored procedure that pulls the data, they are A, B, C, D. I've been asked to add grand totals at the bottom of the report for each sales type.
From my research it appears I need to use RunningValues in an expression to generate these totals but I've been unable to find any useful examples. I've tested for the Tot. Sales column using the expression =RunningValue(Fields!TOTSALES.value, sum, "SALTYPE") but it throws an error I'm not sure I'm interpreting correctly, "The Value expression for the text box 'Textbox168' has a scope parameter that is not valid for the aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a dataset". If I understand correctly it's referring to "Tablix1_SALTYPEGroup" but I'm unclear what that should be or if I'm completely off base.
Can anyone provide an example to get those grand totals or point out the flaw in my expression? I've been all through MSDN but primarily been referencing this blog.
So I may be incorrect but it appears they way I had my groups structured and the details sorted it wasn't possible to generate the totals I needed. I resolved this by simply adding a summary Tablix below my first one, using the same data but structured and sorted in a way to easily generate my totals. By sorting the details on the SALTYPE I could then just add a total and hide the details. The result is exactly what I was looking for.

Identify if objects are the same

I want to check certain objects against each other and identify if they are the same.
For example, I need to verify that the total cost in one page is the same as another page. I developed a script that works, however the total cost changes every day so I have to update the object properties in maintenance mode every day.
Is there a way that UFT automatically recognizes this object must change and update?
I request you to elaborate your question. For now, you can use .* if certain values of the object are changing. Alternatively, you can store the values in an excel sheet and you can change everyday depending on the requirement.
If this is not helpful let me know
It sounds like you actually want to compare the values shown in two different objects, and see if those values are the same. (I assume this because you say they are on two different pages)
Also, you mention maintenance mode, so I assume you are using checkpoints to store their expected values.
I would suggest: instead of storing the expected values in a checkpoint, you could read the value of the first object (getROproperty), store it in a variable (dataTable field, environment variable, etc), and then navigate to the other page, read the ROproperty from the other object, and then compare.
i.e.
if {browser,page,object...}.getROproperty({whateverPropertyYouNeed}) = environment({storedFirstValue}) then
reporter.reportevent micPass,"compare step","{details here}"
end if
*replace stuff inside {} with your code, I don't know what it is
If you need to actually store the total cost externally, you could use a DataTable field and export the sheets at the end. then import the same sheet at the beginning. That would save the data to an excel sheet on a drive.

Browse field data shows value, but displays another value

I have a formula written for a field in Crystal Reports. When i refresh the report, i get a different value from the formula. The required value is always the last value in Browse Field Data dialog for that formula.
Isnt the formula supposed to have only one value as output? why are multiple values shown in browse field data dialog.? Is there a way to retrieve last value of Browse File Data dialog?
My formula looks like below:
WHILEREADINGRECORDS;
NumberVar CODTOTAL;
if {XXX.YYY} = 1 then
( CODTOTAL := CODTOTAL + {XXX.ZZZ};
);
CODTOTAL;
Browse field data shows all the values "CODTOTAL" acquires as a result of that formula and displays a random value amongst the assigned value.
Please help me out. I am amateur in crystal reports.
Any help would be highly appreciated.
~Regards.
First observation should be where have you placed the formula (Details, Footer.. etc).
why are multiple values shown in browse field data dialog.?
Browse field shows the data that is present in the table but in your case you are applying "If" condition of the filed. It can be possible that there is only one record that satisfies your condition.
I would suggest to run the report without the codition, Check the results and apply the condition and check results again.

Resources