Click here to Skip to main content
15,887,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
sum of 2 or more sub report total in main report?


What I have tried:

I am trying to get grand total of 3 subreport total in main report as grand total.
Posted
Updated 1-Nov-16 1:55am

1 solution

Quote:


You can add up the values passed back from the subreport by keeping track of them via a global variable in the main report.

//Initialize the variable in the Group Header of the main report
whileprintingrecords;
numbervar groupsub := 0;

//Update the variable in the Details section of the main report
whileprintingrecords;
numbervar groupsub;
shared numbervar subval;

groupsub := groupsub + subval;

//Print the accumulated group value in the Group Footer of the main report
whileprintingrecords;
numbervar groupsub;


Reference: how do i sum data pulled out of a sub-report in crystal - Stack Overflow[^]

Hope, it helps :)
If you get any issue implementing the approach, please let me know.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900