suppress text object if field value is null in crystal
Asked Answered
A

5

7

I am trying to suppress the text value in crystal by right clicking on the text object, selecting suppress and hitting the x2 button and adding the formula

isnull(field) 

When I look at the print preview the text is still there when the field value is null.

Archilochus answered 6/9, 2014 at 1:15 Comment(2)
Do you mean right-clicking on the text object, selecting Format Text..., checking the box beside Suppress, then hitting the x-2 button?Articulate
@Articulate this is what I see as well.Community
A
14

In the formula section, I changed the code from

isnull(field)    

to

if {field} = "" then 
 true;
Archilochus answered 6/9, 2014 at 3:54 Comment(1)
I've looked for this simple answer for awhile. THANK YOU!Zobias
M
0

In Crystal Reports a placeholder will still be on-screen when you hover over a suppressed field. Since the field is NULL there really won't be a visual difference between NULL and suppressed fields.

Morey answered 6/9, 2014 at 2:12 Comment(0)
A
0

I can put my field in a section, right-click on the section (left margin of the editor) and select Section Expert... In the Section Expert, I ensure the correct section is selected, then I can check the box for "Suppress Blank Section".

Articulate answered 31/12, 2018 at 19:14 Comment(0)
S
0

Really all you needed was a pair of {} inside ().

Correct line of code to suppress anything in report if it's null is:

isnull({your_report_name.database_field_name})
Strawworm answered 13/10, 2020 at 8:10 Comment(0)
C
0

I suggest:

if ((trim({db.field}) = "") OR (IsNull({db.field}))) then
 >>>
else...
Cosgrove answered 21/6, 2023 at 19:42 Comment(1)
/help/formattingDanit

© 2022 - 2025 — McMap. All rights reserved.