Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Suppress section if field is null

Suppress section if field is null

Suppress section if field is null

Hi all,

I don't understand why this is not working. To me, it should so I must be missing something!

I have a main report with 3 subreports, each in different sections. I want to suppress the sections dependent on the value of a field.
This is working fine, unless that value is null. If the value is null then all sections are shown.
I am using the following suppression formula (as you can see, I have tried to cover all bases!)

({CERT_AN_REP\.COA_FMT} <> "COA_SHET") or (isnull({CERT_AN_REP\.COA_FMT})) or ({CERT_AN_REP\.COA_FMT} = '')


RE: Suppress section if field is null

Managed to get this working now....
For some reason, I have to check for nulls first. This code works

isnull({CERT_AN_REP\.COA_FMT}) or {CERT_AN_REP\.COA_FMT} = ''

RE: Suppress section if field is null

Yes, you always have to check for null first. The reason for this is in the nature of null values - when you compare anything to a null value, the result is null, which is neither true nor false. Since Crystal works from the left of the equation to the right and, with "or" statements, it stops a the first null or true value, and it's looking for true or false (note that this doesn't include null!), you have to do the null check first. This is also the way that most databases work.


Senior Manager, Data & Analytics

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close