Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Nov 17, 2017 at 05:44 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 18, 2017 at 06:38 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 17, 2017 at 06:03 PM

    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

    Add comment
    10|10000 characters needed characters exceeded