Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Clearing a string Variable Post Reply Post New Topic
Author Message
cfrey
Groupie
Groupie


Joined: 06 Feb 2008
Location: United States
Online Status: Offline
Posts: 55
Quote cfrey Replybullet Topic: Clearing a string Variable
     Posted: 06 Feb 2008 at 10:57am
I have the following formula in my group header:

global stringvar Policy := " ";

And the following formula in my group footer:
 
global stringvar Policy;
Policy := Policy & ", " & {POLICIES.POLICYNUMBER};

But my field never clears. How can I clear the formula?
Thank you

IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 06 Feb 2008 at 11:29am
Add "WhilePrintingRecords;" as the first line. This will force it to be executed as the report runs.

I discuss this technique as well as other uses of the evaluation time keywords in Chapter 7 of my book Crystal Reports Encyclopedia.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
cfrey
Groupie
Groupie


Joined: 06 Feb 2008
Location: United States
Online Status: Offline
Posts: 55
Quote cfrey Replybullet Posted: 06 Feb 2008 at 11:47am
I added whileprintingrecords but the field is still not clearing. It is basically a running total.
 
Is there anything else I should be doing?
 
Thanks
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 06 Feb 2008 at 3:44pm
I'm not sure what to tell you. It's a pretty simple task that always works. What about double checking that the first formula is being called appropriately? Add another variable (a number) and increment it by 1 each time. Then see if the value increases as you expect. 
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
cfrey
Groupie
Groupie


Joined: 06 Feb 2008
Location: United States
Online Status: Offline
Posts: 55
Quote cfrey Replybullet Posted: 07 Feb 2008 at 6:55am
I did find my error. I had the concatenation clause in the footer instead of the detail. I added a display field and it looks good.
 
Thank you for your help. I bought your book about a month ago and have found it very helpful. I also like this website very much.
 
Thank you.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 07 Feb 2008 at 7:52am
Glad to hear you got it working! Great to hear that you like the book as well.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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