Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Passing shared variable from subrpt to main rpt Post Reply Post New Topic
Author Message
TonyM70
Newbie
Newbie


Joined: 06 Apr 2011
Online Status: Offline
Posts: 9
Quote TonyM70 Replybullet Topic: Passing shared variable from subrpt to main rpt
    Posted: 13 Apr 2011 at 2:53am
I have a subreport in Da that passes an SV to Db and is used in the supression formula for section Db.
 
Will an SV be evaluated even though there are no records in the subreport that contains it?
 
I have observed that the SV in subrpt Da is evaluating to a value of 1 despite having a blank subreport.
 
Thanks in advance for your input.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 14 Apr 2011 at 3:16am
Is it evaluating to 1 or is it using the value of the prior subreport.
 
That is what I have found to be the case, in most cases.  The subreport runs, it has no records, so it doesn't change the SV, leaving it as is.
 
A simple solution around this is to create another detail section, move it to Da (and Da to Db, etc) and reset the SV there, so that you are guarenteed that the value is what you think it should be.
 
HTH
IP IP Logged
TonyM70
Newbie
Newbie


Joined: 06 Apr 2011
Online Status: Offline
Posts: 9
Quote TonyM70 Replybullet Posted: 14 Apr 2011 at 7:07am
thanks for the prompt response.....
 
Looks like it is retaining value from previous subreport. I will test with your suggestion and advise.
 
Was wondering if I am handling null value(s)/record(s) correctly.
 
(i.e. in the formula that is calculating the SV will Exception For Nulls vs. Default Value For Nulls)
 
Should I expect this setting to effect the evaluation of the SV or not?
 
IP IP Logged
TonyM70
Newbie
Newbie


Joined: 06 Apr 2011
Online Status: Offline
Posts: 9
Quote TonyM70 Replybullet Posted: 14 Apr 2011 at 8:04am
need to do validation of a larger data sample but looks like either method produces the desired result.....
 
thanks again for your help!
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.047 seconds.