Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Running Total to Sub Report 1

Status
Not open for further replies.

Senseial

Programmer
Feb 11, 2004
40
CA
Hello All

I have running total in my main report. I also have running total in my sub report. How can I pass running total field form my SUB report to my Main report to do
SUM1 - SUM2 = Grand total.

Thanks a lot.
 
In your subreport, create a shared variable:

whileprintingrecords;
shared numbervar sumx := {#yourrunningtotal};

Place this on the subreport canvas (probably in the report footer, where you have the final value within the subreport).

The subreport will need to be placed somewhere above where you want to reference the shared variable in the main report, so if you have it in the report footer, insert a report footer_b where you will place your summary formula:

//{@grandtotal}:
whileprintingrecords;
shared numbervar sumx;

sumx + {#mainrptrunningtotal}

-LB
 
Thank you so much. I am learning CR and this was part unknow to me. You get a star for such a quick response.

Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top