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!

Using variables from a sub-report in the main report

Status
Not open for further replies.

Greeham

Programmer
Feb 7, 2001
4
ES
Dear friends,

I've got the following question:
- How can I use sub-report declared variables in the main report ?

For example, I want to use a variable declared in a sub-report to be used for calculating a Total in the Main Report.


I hope you can give me an answer.
Thankx.
 
Greeham: Try the following:

1. Create a formula in sub report as follows:

shared numbervar my_total := Sum({Order_Amount})

2. Place sub report in main report so that it executes BEFORE you need the value - i.e. if your main report formula executes in Group Footer then place subreport in Group Header etc.

3. Create a formula in main report as follows:

shared numbervar my_total;

That's it - my_total will now flow through into the newly created main report variable so you can use this e.g. Commission Total = {@Get total} * .15 where {@Get total} is the formula you last created.

HTH David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top