Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Need syntax help with suppressed fields. Post Reply Post New Topic
Author Message
cmemetal
Newbie
Newbie


Joined: 21 Apr 2007
Online Status: Offline
Posts: 4
Quote cmemetal Replybullet Topic: Need syntax help with suppressed fields.
    Posted: 21 Apr 2007 at 8:07pm
If a field is suppressed conditionally, how can I check status of it and use it in another formula?
 
Example:
I have a field set to "Suppress if Duplicated" and I want to suppress a group section based upon a formula to see if that individual field has been suppressed because it was duplicated.
 
This would suppress a group based upon if a field in another group was suppressed or not.
 
Any help is greatly appreciated.
Crystal XI SPK2
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 23 Apr 2007 at 11:03am
You can't check  to see if it was suppressed.  However, in this particular situation, you CAN check to see if it's a duplicate:
 
If {table.field} = previous({table.field}) then ...do whatever
 
-Dell
IP IP Logged
cmemetal
Newbie
Newbie


Joined: 21 Apr 2007
Online Status: Offline
Posts: 4
Quote cmemetal Replybullet Posted: 29 Apr 2007 at 11:35am
That worked great! I never thought of that.
I still have only one sitch that is baffling me.
The first time the header runs, the field is zero. I put in the code and it suppresses all of the first headers because it evaluates to TRUE because it was the previous value of zero.
 
I then added an if statement before it saying if the value is greater than zero, then check the previous value. This works fine for all subsequent loops except for the first one which is zero, so it prints all of the group headers while the value is zero then once it changes to 1,2,3, etc.  then it works fine.
 
Any ideas for when the value is zero and all subsequent values are zero? I may need to use another field or add a counter?
 
Regards,
 
George
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 30 Apr 2007 at 7:22am
Instead of checking for zero, you can use "not PreviousIsNull({table.field})" or "not OnFirstRecord" in your suppress formula to make sure that the first one is not suppressed.
 
-Dell
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.016 seconds.