Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Help With Shared Variables Post Reply Post New Topic
Author Message
flanman
Senior Member
Senior Member
Avatar

Joined: 04 Nov 2009
Online Status: Offline
Posts: 123
Quote flanman Replybullet Topic: Help With Shared Variables
     Posted: 02 Apr 2010 at 7:41am
Ok.. this is my first stab at using Shared variables, and not working great so  far. Here is what I have so far. A report and a subreport .. all working fine here. I have a subtotal number in the sub report I need to use in the main report. In the sub report I created the following formula:

Shared NumberVar SubAvgPerformed;
SubAvgPerformed :={@AvgPerformed};

Then in the main report I have the following formula:

Shared NumberVar SubAvgPerformed;
AvgPerformed;

Currently I am just placing the formula on the main report to make sure
the value is carrying over, but all I am getting is zeros.

What might I be doing wrong?

Thanks,
Flanman
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 02 Apr 2010 at 7:52am
In the main report, second line.  You should have SubAvgPerformed not AvgPerformed.
If that is a typo in the post then is the your formula for the main report after the sub report?


Edited by kevlray - 02 Apr 2010 at 7:53am
IP IP Logged
flanman
Senior Member
Senior Member
Avatar

Joined: 04 Nov 2009
Online Status: Offline
Posts: 123
Quote flanman Replybullet Posted: 02 Apr 2010 at 8:08am
Sorry that was a typo. In the actual formula I have SubAvgPerformed.

In the main report the subreport value and shared value are both in the same group footer section.

IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 02 Apr 2010 at 9:07am

Create a second group footer section and put the formula there.  I am speculating that the formula is being displayed before the subreport is completing.

 
I hope this helps.
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