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

Use a field from a subreport in a calculation formula

Status
Not open for further replies.

Tonyvee73

Technical User
Jul 4, 2018
10
GB
Hi Guys
I have a field from a sub report and its showing fine in the main report (Say total 1)
Now i need to write a formula in the main report to calculate that Total1 + Total2 = Total3 but dont know how to reference the field from the subreport (I can access formulas by the '@' and parameters by the '?' but am lost with referencing subreports in formulas. Can someone help?
 
Create a shared variable in the subreport to contain your Total1.
ie: {@SharedUpTTL1} as: shared numbervar ttl1 := {@Total1};

create a matching shared variable in the main report.
ie: {@SharedTTLT1} as: shared numbervar ttl1;

you should be able to use the new variable in the main report almost anyplace after the subreport.
 
In any section after the section the sub-report is in and the section the sub-report is in cannot be suppressed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top