Link to home
Start Free TrialLog in
Avatar of Dave Stone
Dave StoneFlag for United States of America

asked on

Suppress Section if Field is Null

Hello,
      I have a report that is grouped by Customer, then Engine Program, then Part Number. I would like to suppress everything for the Engine Program and Part Number sections if the Engine Program field is null. In other words I only want to see results if there is a value in the Engine Program field. Can this be done.
I have attached a copy of the report in case it helps.

Thank you
example.rpt
Avatar of Mike McCracken
Mike McCracken

If the engine field is null you won't get  a group for it.  It is automatically suppressed.

mlmcc
Nontheless CR might react irregular on dbNull values ... and besides of that it ist probably more self-documenting to cast that behaviour into some formula.

In the formatting formula "suppess section" of the two sections you could enter:
IsNull({engine})

Open in new window

That would suppress these sections when "engine" is dbNull without CR freaking out on the value. (the field name might differ in your report ... :)

Furthermore you could insert another section telling "No engine defined" and garnish that with a suppress formula
not IsNull({engine})

Open in new window

to inform the reader about the condition (that behaviour can't be realized with the default outlined by mlmcc ...).
It's been a while, but, contrary to what mlmcc said, I don't think CR suppresses a group if the field is null (I'm pretty sure I've seen a report with a group for a null field).  I would hate to think that CR would just remove a whole group from the report because the group field was null.

 The "Engine Program" field that you're referring to is tcspnm.pohspec, correct?

 Is pohspec actually null, or is it just blank?  Those are two different things.  In your example report, that field is sometimes blank, but it's never null.

 What do you want to "suppress"?

 If you want to get rid of the entire group, including the details, the simplest thing would be to go into the record selection formula and add

and {tcspnm.pohspec} <> ""

 That's assuming that the field is actually blank, not null.

 If the field actually can be null at times (not just blank), you could add

and not IsNull ({tcspnm.pohspec})


 That will remove any records where pohspec is blank (or null in the second case) from the report completely, so they won't be included in any summaries either.

 For the record, instead of using the record selection formula, you could suppress the desired sections when the field was blank (or null), but then the report would still be reading those records and they would be included in any summaries.

 James
Avatar of Dave Stone

ASKER

Ok, what if I did not want to suppress it but have a label like "UnKnown" instead of the blank if the the tcspnm.pohspec field is blank or null ?
ASKER CERTIFIED SOLUTION
Avatar of Frank Helk
Frank Helk
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks to all.