Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Subreport Shared NumberVar Post Reply Post New Topic
Author Message
MrCastalum
Newbie
Newbie
Avatar

Joined: 11 Mar 2010
Location: United Kingdom
Online Status: Offline
Posts: 22
Quote MrCastalum Replybullet Topic: Subreport Shared NumberVar
     Posted: 21 Jun 2010 at 9:55pm
I am using Crystal Reports XI.

I have a problem with a subreport. I need to use a shared numbervar because as you can see below, I am calculating Net, VAT, and Gross and the only way I can get the gross is to add the Net and VAT together. However, when I do this for each customer, the shared numbervar applies itself to every customer after the one that actually has the VAT. (The -90.00 in the top left is the actual subreport. As you can see there is no number in top left of the next customer, but the shared variable carries on applying itself until the next value in the subreport.)


IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 22 Jun 2010 at 3:14am
before the subreports run, set the shared variables to 0
like:
 
shared numbervar VAT := 0;
"" //i do this to hide formula displaying 0
 
HTH
IP IP Logged
MrCastalum
Newbie
Newbie
Avatar

Joined: 11 Mar 2010
Location: United Kingdom
Online Status: Offline
Posts: 22
Quote MrCastalum Replybullet Posted: 22 Jun 2010 at 4:07am
Fantastic! Thanks very much! Thumbs%20Up
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