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!

Problem passing variables from sub-report to main report.

Status
Not open for further replies.

RWahlert

MIS
May 17, 2004
51
US
I'm working on a report that returns sales information grouped by item. The detail information contains quantities, selling price, extended price, etc.

I have a subreport in the group footer that looks for a certain discount level for the item. I want to return this cost back to the main report and then multply the sum of the item quantities with the cost determined by the sub-report.

My variable is shared and I am returning a value in to the main report. However, when I create a formula in the main report that uses the variable the value for the variable is what was determined for the prior group.

In other words the cost from group A is being passed to Group B.

Any ideas on why my variable is not passing correctly would be appreciated.
 
First, the shared variable must be positioned in a section below the one in which the subreport is executing. You also might need a reset formula in the main report like:

whileprintingrecords;
shared numbervar discount := 0;

Place this in a section either before the subreport of after the shared variable calculation in the main report.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top