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!

Sub reports

Status
Not open for further replies.

diannelight

Technical User
Feb 24, 2003
59
US
Can I reference the value from a Formula/Variable/SQL Expression in the main report, from a sub report?
 
Unfortunatley no. You can't reference any value from another report in Crystal (unless version 9 has fixed this, I use 8.5) so if you have a main report you can't reference a total on a subreport and vice-versa. The only way to do it is to find a way of getting the value that you want to reference from the main report into the data source (I assume a stored procedure) that runs the subreport, but this might not always be possible

JC
 
JC, thank you for your response - that really helps. I'm using 8.5 but I read about 'shared variables' in version 9. Would you know if this functionality is available in 8.5?
 
Dianne,

I think you've been misled a little here.

It doesn't matter if you're using version 8, 8.5, or 9, using shared variables you can always transfer values between sub and main reports.

If you assign your value to a shared variable in your subreport, as long as you don't attempt to call the shared variable in the main report until after the section with the subreport has completed, you can utilise the shared variable as you would any other variable.

Naith
 
You can also use cut-and-paste on the code, to recreate a useful formula from the main report in a subreport. It depends what the particular need is.

Madawc Williams
East Anglia, Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top