Use two variables. One to do the calculation, and another to accumulate the total. This could be done in the sub report as a Shared variable so it could be passed back to the main report, or in the main report itself as a Global variable. I would take the latter approach. Just amend the formula in the main report that is used to display the variable to something like this (where the variable used in the sub report is called "SRvar"):
Code:
WhilePrintingRecords;
Shared NumberVar SRvar;
Global NumberVar Tot;
Tot := Tot + SRvar;
SRvar
Then, to display the accumulated total, use the following code:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.