Skip to Content
author's profile photo Former Member
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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    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 ?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.