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

Shared Variable Problem

Status
Not open for further replies.

knagy

Technical User
Apr 6, 2005
13
US
I am having problems getting any shared variables to work going from a subreport to the main report. I am using Crystal Reports 9 and created a simple test to figure out what I am doing wrong. In my subreport I wrote the following formula:

@Text Test
WhilePrintingRecords;
shared stringvar TESTTEXT := "Test";


I put this in my group 1 footer and in my subreport it displayes "Test" in each group footer. I then wrote the following formula in my main report:

@Get Test
WhilePrintingRecords;
shared stringvar TESTTEXT;
TESTTEXT

No matter what I do, all I get in the main report is a blank field. I have placed the subreport in different places (the report header, the page header, the group header, a second details section, etc.) all with the same blank results. I have placed the @Get Test formula in different places all with the same blank results. I have tried to link the subreport to the main report by the @Get Test formula, the field which is being used to create the Group 1, and other options that I can't even remember any more. No matter what I do, all I get on the main report is a blank field. Can someone either tell me what I am doing wrong, or post a small sample of a shared variable that would work. What is even more frustrating for me is that I can get global variables to work. Thank you in advance for any help you can give me.
 
I have figured out that part of my problem has to do with suppressing the subreport. If I don't suppress it, I get the results I want on the main report. However, when I suppress the subreport, I get a blank field.
 
Hi,
If the sub is supressed, then it will not assign the value to the shared variable..That will only be there after the sub runs...








[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top