Print Page | Close Window

Need syntax help with suppressed fields.

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=562
Printed Date: 04 May 2025 at 8:27am


Topic: Need syntax help with suppressed fields.
Posted By: cmemetal
Subject: Need syntax help with suppressed fields.
Date 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



Replies:
Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: cmemetal
Date 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
 


Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window