Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Shared variables not visible on Main Report Post Reply Post New Topic
Author Message
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Topic: Shared variables not visible on Main Report
     Posted: 30 Aug 2012 at 3:16am
I'm in Crystal 2008. I've created Shared Variables to pass through data from my sub report to my main report. No errors on any of the formulas in my sub or my main report. When I add the variables to my main report, no data appears. Here are the shared variables that I've set up in my sub-report:
Whileprintingrecords;
Shared datetimevar Effect_Date;
Effect_Date:= {EMDEDMASTR.EFFECT_DATE};
 
Whileprintingrecords;
Shared datetimevar End_Date;
End_Date:= {EMDEDMASTR.END_DATE};
 
Whileprintingrecords;
Shared stringvar Ded_Code;
Ded_Code:= {EMDEDMASTR.DED_CODE};
 
Whileprintingrecords;
Shared numbervar Next_Amt;
Next_Amt:= {EMDEDMASTR.NEXT_AMOUNT};
 
Whileprintingrecords;
Shared stringvar WhattoAudit;
WhattoAudit:= {@fWhattoAudit};
 
I've declared these shared variables in my Main Report with no errors, yet they do not appear. Is there something else I need to do to get these to appear?
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Aug 2012 at 3:47am

1. can you se the value in the sub report?

2. Is the variable in the main report placed in a section below where the sub report is located (e.g. subreport is in group header A and variable is in group header B?)
 
3. Is the sub report suppressed? If os it does not run and thereefore will return no values.
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 31 Aug 2012 at 5:49am
have you tried creating global shared variables?
IP IP Logged
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Posted: 31 Aug 2012 at 6:17am
Well, not sure what a Global Shared Variable is! I will look that up, unless it's easy to explain and you can post about it here.
 
Otherwise, I am thinking the tables I am connecting to actually do not have data in them. We are just lanching the new payroll system thsi week and I think the tables were cleared out of their data. That would be the obvious reason the data is not appearing, because when I ran the report without the shared variables in the report, I noticed that the sub-report did not have data in it like before either. So that's the first thing I'll need to check...
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum