Former Member

# Crystal Reports XI - Suppression Formula

I am trying to suppress different sections based on fields in my report. I have checked that the formulas are working by placing them in the report and have checked that they are returning the correct boolean result. I have three sections using the forumulas below;

Section A

```If pagenumber MOD 2 = 0 then true
else
If {Student__02_03_.Date of Birth}<>DateTime(1900,1,1,0,0,0) and {Student__02_03_.Ethnicity}<>"99" then
FALSE
else
TRUE```

Section B

```If pagenumber MOD 2 = 0 then true
else
If ({Student__02_03_.Date of Birth}=DateTime(1900,1,1,0,0,0) and {Student__02_03_.Ethnicity}<>"99") then
FALSE //If either date of birth & ethnicity are blank or unknown then show this header
else
If ({Student__02_03_.Date of Birth}<>DateTime(1900,1,1,0,0,0) and {Student__02_03_.Ethnicity}="99") then
FALSE //If either date of birth & ethnicity are blank or unknown then show this header
else
TRUE // if not then supress```

Section C

```If pagenumber MOD 2 = 0 then true
else
If ({Student__02_03_.Date of Birth}=DateTime(1900,1,1,0,0,0) and {Student__02_03_.Ethnicity}="99") then
FALSE //If both date of birth & ethnicity are blank or unknown then show this header
else
TRUE // if not then supress```

For my first result in the report this always returns the correct section. However, from the second result on it hides all of the sections, despite showing the correct result in CR (they show FALSE, TRUE, TRUE for each record in my current result. But the first section does not display.

If I remove the suppression formula it works fine through the report, but unfortunately this does not help me! Can anyone offer any suggestions?

Edited by: cataylor951 on Jan 12, 2011 12:08 PM

10|10000 characters needed characters exceeded

### Related questions

• Former Member
Posted on Jan 12, 2011 at 01:02 PM

>

> I am trying to suppress different sections based on fields in my report. I have checked that the formulas

are working by placing them in the report and have checked that they are returning the correct boolean result.

I have three sections using the forumulas below;

>

> Section A

>

```If pagenumber MOD 2 = 0 then true
> else
> If {Student__02_03_.Date of Birth}<>DateTime(1900,1,1,0,0,0)
> and {Student__02_03_.Ethnicity}<>"99" then
> then   FALSE
> else   TRUE```

>

> Section B

>

```If pagenumber MOD 2 = 0 then true
> else
> If ({Student__02_03_.Date of Birth}=DateTime(1900,1,1,0,0,0)
> and {Student__02_03_.Ethnicity}<>"99") then
>     FALSE
> //If either date of birth & ethnicity are blank or unknown then show this header
> else
> If ({Student__02_03_.Date of Birth}<>DateTime(1900,1,1,0,0,0)
> and {Student__02_03_.Ethnicity}="99") then
>     FALSE
> //If either date of birth & ethnicity are blank or unknown then show this header
> else TRUE // if not then supress```

>

> Section C

>

```If pagenumber MOD 2 = 0 then true
> else
> If ({Student__02_03_.Date of Birth}=DateTime(1900,1,1,0,0,0)
> and {Student__02_03_.Ethnicity}="99")
> then  FALSE
> //If both date of birth & ethnicity are blank or unknown then show this header
> else
>     TRUE // if not then supress```

>

> For my first result in the report this always returns the correct section. However, from the second

result on it hides all of the sections, despite showing the correct result in CR

(they show FALSE, TRUE, TRUE for each record in my current result. But the first section does not

display.

>

> If I remove the suppression formula it works fine through the report, but unfortunately this does not

help me! Can anyone offer any suggestions?

>

> Edited by: cataylor951 on Jan 12, 2011 12:08 PM

What do you mean by: from the second result ?

10|10000 characters needed characters exceeded
• Former Member
Posted on Jul 02, 2012 at 07:12 PM

For some reason, Crystal does not evaluate the IF <condition> THEN FALSE correctly on field suppression. If you change your statement and reverse your evaluation to be IF <condition> THEN TRUE, it should work.

I still do not understand why IF <condition> THEN FALSE does not evaluate the same as IF NOT <condition> THEN TRUE.

10|10000 characters needed characters exceeded
• Hi Debra

Could you please share the report with saved data? Rename the file extension to .txt before you upload the file.

Regards

Nikhil Sabnis