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

Passing parameters from subreports to main reports.

Status
Not open for further replies.

yagnik3128

Programmer
Jun 14, 2001
64
IN
I have called 2 subreports in main report & both the subreports are having some grand total & i want that grand total in main report.

Is it possible?

Like,

main report is haveing a party wise amount grand total & subreport is also having some interest total.

& i want to calculate both the total in main report.

Please help me.
 
Dear Yagnik,

You can pass any value between the main and subreports using a shared variable - as opposed to a global variable.

using this declaration at the beginning of a formula -

shared numbervar x:= Sum(dbfield.Last Years Sales);

will store the value

declaring it in the main report the same way:

shared numbervar x;

x will remember what the subreport stored in it - then use it in further calculations.

Hope this helps

paulmarr@arcom.com.au
 
It is also important to retrieve the variable in a section AFTER the subreport.

A subreport in the same section is processed after all the formulas, so the shared variable has the prior value.

it you have to, use multiple sections (GH1a, GH1b, etc.) and set "Underlay to make them print nicely. Put the subreport in GH1a, and underlay it. Make sure the subreport formula saving the value into a shared variabl;e is used in the subreport. Put the formula with the retrieved shared variable in GH1b. Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top