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

Global Variable in a SubReport Calling it from Another 4

Status
Not open for further replies.

konad

Programmer
Jan 5, 2001
43
US
if i declared a global variable in a sub report, shouldn't i be able to call it within that report by anything including another subreport, main and etc... ??

i can't seem to find anything on how i use that global variable.
 
konad,
I believe that a global variable is only one way, for example from main report to sub. If you are using CR8 you can delcare a "shared" variable and it is accessible to any portion of your report, including subreports. I had a similar situation where I uses a shared array and a shared subscript variable and it worked great! Give it a try.

Dan.
 
Konad

Depending upon the version of Crystal, In Ver 7, you would call your variable "Shared" in the subreport and create a variable in your main report called "Shared" with the same name. It will retrieve the variable from the subreport. I don't think you can pass a shared variable from 1 subreport to another without utilizing the main report to transition the data.

It's also important where you place your subreport within the main report.

I hope this helps.....
Ruth
 
Global variables are only global within the main report or subreport. They don't cross the line. That is the difference between global and shared. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
ok from what i have read "me thinking again" you can't used a variable outside of the "subReport" or "mainreport" even if its all on one report?
 
Shared variables can be used in the main report and sub-reports to that main report.
 
well doot, i tried the shared variable with no error however i get a 0 value :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top