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

Shared Parameter, Pass Back From SubReport

Status
Not open for further replies.

bernie321

Programmer
Jan 7, 2004
477
GB
Hi

We have the below code to pass a value back from a subreport.

{@PassToMainRpt_PriTotal} works fine in the subreport, but {@excl_Pri} returns zero in the main report.

//In Subreport {@PassToMainRpt_PriTotal}
whileprintingrecords;
shared currencyvar PriTotal;
PriTotal:={@Total};
PriTotal

//In Main Report {@excl_Pri}:
whileprintingrecords;
shared currencyvar PriTotal;
PriTotal


Any help would be much appreciated

Thanks
B
 
Make sure your first formula is placed somewhere on the subreport canvas.

Your second formula must be placed in a section below the one in which the subreport is placed in the main report.

-LB
 
Ahh, thats the problem.

Is there any method of placing it above the subreport, as we need to summarise all the subreports on the first page?

Thanks

B
 
Not really. If the subreports are unlinked subreports, you can add them again in a report header_a section, suppress all sections within each subreport, and then use the shared variables in a report header_b section.

If they are linked to groups in the report, you would have to add the subreports to the report header_a section as unlinked reports and then add selection criteria restricting each report in the same way the linking would. So if you had one subreport that executed once for each of three groups, you would have to add it three times, each time restricting the subreport records to one instance of the group. Probably not feasible.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top