In Crystal Reports, how do I keep a row from printing if the value is null?

johnny picture johnny · Aug 12, 2013 · Viewed 17.4k times · Source

I have a null value in my report. I went to the formula workshop editor and put IsNull({myreport.field}) but the row shows on the report. It has "FALSE" or "TRUE," and it putting all the records on there.

How do I actually make it suppress or not show the records if the value is null? What do I put in IF THEN (Is that what I use?)? I don't want it on the report at all.

I am using Crystal Reports 2011 XI.

Answer

ifthenelsenull picture ifthenelsenull · Aug 13, 2013

I usually use this formula to suppress blank sections. It goes in the section expert supress formula editor.

IF ISNULL({myreport.myfield}) then TRUE   
ELSE IF {myreport.myfield} = " " then TRUE   
ELSE FALSE

Since you are in the suppression field you are telling it that supress = true if the conditions are met else they are not true and it should not be supressed. I use the empty string condition to cover issues where it's not NULL but still blank.