I have a subreport that I've incorprorated into a main report. Both reports have a final total value. I want to add those 2 values together. How do I accomplish this?
In the subreport, create a formula that makes the subreport total a shared variable, as in:
whileprintingrecords;
shared numbervar subrpttot := sum({table.amount}); //substitute your
//subreport total calculation for sum({table.amount})
Place this on your subreport. Then in the main report, create a formula:
whileprintingrecords;
shared numbervar subrpttot;
subrpttot + sum({table.mainrptamount}); //substitute
//your main report total calculation for sum({table.mainrptamount})
Place this formula in the main report footer. Make sure the shared variable is in a section below where the subreport is executing--insert another report footer section, if necessary.
You're not doing what LB suggested, hence the error.
And you haven't described the requirements, hence the limited guidance.
Read your 2 posts, they demonstrate entirely different requirements.
Try posting technical information:
Crystal version
Database used
Example data
Expected output
In this case it sounds like you have some count occuring at a group level in the subreport, and then you want to return the grand total of the count to the main report.
LB might continue to guess a bit longer, but please consider fleshing out the requirements in advance. think of creating a mini spec which describes the environment, data and output. Text descriptions often confuse more than aid.
If you have a count of a field in the sub, create a variable to sum the count seperately in a formula in the sub, and then return the sum to the main report.
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.