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

Shared variables in subreports

Status
Not open for further replies.

dzavad

Programmer
Apr 17, 2000
167
US
Is it posible to take values from sub1 and adding or subtracting the value from sub2 report.
Can the totals from sub1 be subtracted from the total in section sub2 and then show that as the value in sub2 avoiding main report?
 
Yes, but sub1 must be located in a section above sub2. Create the shared variable in sub1 as in:

whileprintingrecords;
shared numbervar qty := sum({table.qty});

You must place this formula somewhere on the sub1 report canvas.

Then in sub2, create a formula like:

whileprintingrecords;
shared numbervar qty;

qty * sum({table.costs});

...and display it in sub2.

-LB
 
You can used Shared variables to pass values from one subreport directly to another, bypassing the main report. (I think that's what you asked)

For example, place Subreport 1 in Report Footer-a of the Main report.

Place Subreport 2 in Report Footer-b of the Main report.

In Subreport 1, create a formula with a shared variable to store your value. Make sure that you place this formula on the report canvas of Subreport 1. (The formula could be suppressed, if desired)

In Subreport 2, create a formula that references the shared vaiable from Subreport 1 and then add it to whatever value from subreport 2.



Bob Suruncle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top