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

Using values from a subreport in the main report

Status
Not open for further replies.

M8KWR

Programmer
Aug 18, 2004
864
GB
Hi,

I have a main report with 1 sup-report. Within this sub-report i have formula field calculated from 2 fields.

What i want to do is carry this formula field over to the main report so i can calculate a SUM value in certain other sections of the main report.

I hope this makes sense.

many thanks in advance.
 
It is important to know where this subreport is located, whether it is linked to the main report, and if so, on what fields. If the sub is in the report header and is returning one set of values for the whole report, then just create a shared variable in the sub:

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

Then you can reference this value in the main report and use it in calculations like this, for example:

whileprintingrecords;
shared numbervar amt;
sum({table.qty}) % amt

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top