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

Can a SubReport pass a Value back to the main report? 1

Status
Not open for further replies.

DavidKnight

Programmer
Mar 31, 2004
27
CA
I use subreports quite extensively, linking from my main report to sub's. And that works well sending(Linking) values to the subreport.

But how do I return a value, such as number of rows read/displayed, back to the main report?

This is Crystal Reports 9.0!

David
 
Hi David,
you can declare a variable in the subreport via a formula such as :
Code:
shared stringvar MyText:=whatever value you want it to have;
Then in the main report you have another formula such as :
Code:
shared stringvar MyText;
MyText;
Which will be populated after the subreport has run. Be careful of where you put the variable in the main report as the subreport MUST run first so don't place the main formula in the report header and the subreport in the report footer.

Hope this helps.
ShortyA
 
Note that a value from a subreport will not be available until the section after the section containing the subreport.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top