Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Suppress condition Post Reply Post New Topic
Author Message
momer79
Newbie
Newbie


Joined: 23 Feb 2009
Location: United Kingdom
Online Status: Offline
Posts: 12
Quote momer79 Replybullet Topic: Suppress condition
     Posted: 21 Apr 2010 at 2:17am
Hi,
 
On my report there is field called ISHighRisk and it has two values "Y" and "N" and this field is displayed with all rows so some rows may have "Y" and some rows may have "N".
 
I want to show label on the bottom of the report only if report has any "Y" value otherwise suppress it.
 
iI have tried following statement on label suppress formula but its not working.
 
IF ({Command.IS_HIGH_RISK}="Y")  THEN
    TRUE
 
How can i fix it ?
 
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 21 Apr 2010 at 2:36am
There could be an easier way that one of the experts could tell you, but I would create the following formula:
 
global numbervar nCount:=nCount + (if {ISHighRisk}='Y' then 1 else 0);
nCount;
 
Put this on the detail line and suppress {Command.IS_HIGH_RISK} if:
global numbervar nCount<1
|< /\ '][' ( )
IP IP Logged
momer79
Newbie
Newbie


Joined: 23 Feb 2009
Location: United Kingdom
Online Status: Offline
Posts: 12
Quote momer79 Replybullet Posted: 21 Apr 2010 at 3:45am
thanks alot, thats what i was looking for.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Apr 2010 at 3:55am
The reason it was not working is because your evaluation was looking at one row. Since you placed the criteria in the footer it was looking at the last row. Your condition needed to evaluate all rows and that was what FrnhtGLI was suggesting by using a formula to make a summable amount to detemine your suppression need. THis is a good trick to use. In this case since you only have 2 values you could also use a MAXIMUM () option.
When you say the bottom of the report I assume you mean in the report footer and not a group footer. This is evalauting for the report footer. If you need to evalaute at a group level it can be altered to accomidate that ...
In the section expert or the field you can suppress using the formula:
MAXIMUM({Command.IS_HIGH_RISK})="Y"


Edited by DBlank - 21 Apr 2010 at 3:56am
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