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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass a subtotal back to the main report

Status
Not open for further replies.

sjjustina

IS-IT--Management
Apr 23, 2007
30
US
I have a subtotal in the report footer of a subreport. I also want to print that subreport on the main report in a report footer. Can I assign it to a variable to return to the main report? And if so how?

Thanks, Sarah
 
Please explain in what report section your subreport is located, and what you want to see in the report footer--is it just one value or a set of values?

-LB
 
The subreport is in the main report's report footer and it's just one value that I need to return. Thanks.
 
Okay, then just create a formula like this:

whileprintingrecords;
shared numbervar yoursubtotal := sum({table.amt});

Place this formula on the subreport. Then you can reference it in a section below the one in which the subreport is located, e.g., report footer_b, by using a formula:

whileprintingrecords;
shared numbervar yoursubtotal; //display only

Or for a calculation:

whileprintingrecords;
shared numbervar yoursubtotal;
yoursubtotal * .05 //sample calculation using the shared variable

-LB
 
Thanks, how do I capture the subtotal into the variable? It's a sum total. Thanks.
 
That's what this is:

whileprintingrecords;
shared numbervar yoursubtotal := sum({table.amt});

Substitute your actual subtotal for sum({table.amt}).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top