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!

Passing values from the Main Report to the Sub report

Status
Not open for further replies.

QueTech

MIS
Apr 13, 2003
79
US
Hi,

I am pulling data from a cashe database on Win PX workstation. I am using Crystal 10. My question is can I pass variable values from my main report to my subreport?
 
Sure. they're called shared variables.

Example:

In a section PRIOR to running the subreport:

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

Then in the subreport you can reference it:

whileprintingrecords;
shared numbervar MyValue;
"I have " & totext(MyValue,0,"") & " from the main report"

and you can pass values back.

-k
 
For main-to-subreport, it is easier to use Edit > Subreport Links. Just be aware that it will want to link to something in the subreport, and that this link will be automatically placed in the subreport's record selection. If it's not what you want, it can be edited out.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top