Crystal Report Sum of Multiple Group Summaries

2.9k views Asked by At

I am compiling a report that needs to be arranged by Order (Group 1). I followed the steps provided by Ryan on 4/22 to sum the summary (maximum since the line numbers repeat in the "Details" section of the report) of my group 2 (material cost line item). This worked perfectly. However, I want to add a group 3 (labor cost line item), group 4 (other cost line item) and group 5 (total cost - to sum the totals of groups 2, 3 and 4). Groups 2, 3 and 4 have their own unique line numbers.

group 1: 75        <- sum of the maximums 
   group 2: 50     <- max of the group 2 line
       line 10: 50
       line 10: 50
       line 10: 50
   group 2: 25     <- max of the group
       line 20: 25
       line 20: 25
       line 20: 25
   group 3
       line 10:  5
       line 20: 10
       line 30: 15

Ryan's original response (below) worked perfectly for group 2. Can anyone expand it for use for groups 3 and 4? Any assistance would be greatly appreciated.

//Place this formula in the Group1 Header
whileprintingrecords;
numbervar g1sum := 0;

//Place this formula in the Group2 Footer
whileprintingrecords;
numbervar g1sum;
g1sum := g1sum + maximum({table.value},{table.group2_field})

//Place this formula in the Group1 Footer
whileprintingrecords;
numbervar g1sum;
0

There are 0 answers