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

Sub Reports Help!

Status
Not open for further replies.

Gregsy35

Programmer
Dec 5, 2000
21
CA
sorry guys does anyone know how to retrieve the data from a subreport so i use the data in a formula to be displayed in the main report.
Thanks Guys :)
 
I believe you will need to create shared variables in the main report prior to the subreport, pass the desired values to them in the subreport, and then display the shared variables in the main report. So far as I know shared variables are the only way to pass data between main and subreports. Also, shared variables can only be used WhilePrintingRecords, example:

Formula in Main report:
WhilePrintingRecords ;
Shared CurrencyVar MyVariable := 0 ; // inialized to 0

Formula in Subreport:
WhilePrintingRecords ;
Shared CurrencyVar MyVariable := DataToDispayInMainReport ; // Set to value in subreport

Formula in Main report:
WhilePrintingRecords ;
Shared CurrencyVar MyVariable ;
MyVariable ; // Display value in main report

Hope this helps,
Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top