Skip to Content
0

I need some help using arrays in Crystal Reports using Crystal Developer 12

Nov 17, 2017 at 03:21 PM

41

avatar image
Former Member

I have a report that returns a set of data and groups it by a column Batch_Id. and includes a column Result_Name. What I would like to accomplish is at the end of the report I would like to produce a tally of the Different values of the Result_Name column.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Brian Dong Nov 17, 2017 at 05:44 PM
0

Hi Tim,

You can do this with a Running Total. In the Report Header create a formula that defines and initializes a variable like:

WhilePrintingRecords; 
StringVar Results := ""; 

In the Detail section, create a formula that adds the Result_Name to the variable:

WhilePrintingRecords; 
StringVar Results; 

Results := Results & {table.Result_Name} & ", "; 

In the Report Footer, add one last formula to display the string:

WhilePrintingRecords; 
StringVar Results; 

Left (Results, Length (Results) - 2); 

I used the Left function to remove the last ", " from the string.

Good luck,

Brian

Share
10 |10000 characters needed characters left characters exceeded
Abhilash Kumar
Nov 18, 2017 at 06:38 AM
0

Hi Tim,

Here's what you need to do:

1. Insert a Crosstab. Use the 'Result Name' column as the Row of the Crosstab and the Sample Number field as the 'Summarized Field'.

Set the summary function to 'Count'.

2. Place the crosstab on the Report Footer.

3. Go to the Crosstab Expert > Customize Crosstab > Get rid of the Gridlines if you don't need them.

-Abhilash

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Nov 17, 2017 at 06:03 PM
0

I don't think I explained it well enough.

for the example above what I would look for as the report footer would be something like:

Settle Plate Count - 8

Surface Sample Count - 8


capture.png (140.1 kB)
Share
10 |10000 characters needed characters left characters exceeded