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}
有帮助吗?

解决方案

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}

其他提示

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

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top