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

how to pull sub-total value from sub-report and use in main report?

Status
Not open for further replies.

Lnxvas

Programmer
Oct 15, 2008
15
0
0
US
using CR2008
i created a report which has a subreport.

in supreport i have sub-total for 1 column and i have to use this value in main report to calculate the total.

how do i get the value from subreport to use in the main report?

can anyone help?

Thanks a bunch.
 
Set the value in the subreport to a shared variable, which is placed in the subreport footer, as in:

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

Then in the main report, in a section below the one containing the subreport, reference the variable and use it in your calculation (sample calculation follows).

whileprintingrecords;
shared numbervar x;
x/{table.otheramt}

If your subreport is in a group section, you will likely need to set up a reset formula to place in the group footer:

whileprintingrecords;
shared numbervar x := 0;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top