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!

Variable or Formula passed to Subreport

Status
Not open for further replies.
Nov 9, 2005
1
US
I am tring to get a variable or formula from the main report passed to a subreport for calculations in the subreport. Do you have any examples of how to set these up?

 
If you haven't already tried this...

Right click on your subreport in either design view or preview. Then click on "Change Subreport Links". Your formula should show up in the listing in the upper left window. Click on ">" to get it into the upper right window. Then it should appear in the list at the bottom of the form. Uncheck "Select data in subreport based on field:", since (I'm assuming) you won't be linking the formula to any existing fields in your subreport.

Hope this helps...
 
In the main report, create a formula:

whileprintingrecords;
shared numbervar mainval := {@yourformula};

Place this formula on the main report in a section above the one in which the subreport is executing.

Then in the subreport, create a formula:

whileprintingrecords;
shared numbervar mainval;
mainval + {@mysubvalue} //for example

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top