0
votes

I have one formula in crystal report, which displays fixed text if the value is null. this works fine. but if the report is blank, then also i see the fixed text.

My Question: How to NOT show the fixed text when the report is blank?

Below is the formula.

Local StringVar x;

If IsNull({objectName}) or ({objectName} ="" ) then

x := "Fixed Text"

Else

x :={objectName}
3

3 Answers

0
votes

Maybe you can try to check if the object has empty string as well, by using trim()

If IsNull({objectName}) or (trim({objectName}) ="" ) then

x := "Fixed Text"

Else

x :={objectName}

0
votes

Can't you use predefined functions like RecordNumber()? Or you can just calculate Count({somefield}) and when that's zero, then disable text.

0
votes

On the formula field on the report, go to the formula option of suppress and enter the following:

currentfieldvalue = "Fixed Text"

This should suppress the field when it contains that text.