开发者

Crystal Report: If-Else If Formula

开发者 https://www.devze.com 2023-02-03 01:43 出处:网络
For one string field in crystal report i wish to write up formula where if that field is null, it should display as \"No value\" elsethe actual values should come up

For one string field in crystal report i wish to write up formula where if that field is null, it should display as "No value" else the actual values should come up

What i have written is

Local StringVar x; If {mysp;1.mystringfield} ="" or IsNull({mysp;1.mystringfield}) then x := "No value";开发者_JS百科 Else x := {mysp;1.mystringfield}

The bold marked shows error saying "the remaining text does not appear to be part of the formula crystal reports"

Whats incorrect in my formula?

Let me know for more inputs

thanks


I think you need to remove the ; and wrap the or in brackets:

Local StringVar x; 

If (IsNull({mysp;1.mystringfield}) or {mysp;1.mystringfield} ="") then 
x := "No value"
Else x := {mysp;1.mystringfield}


IF Isnull({mysp;1.mystringfield}) Then
  "No Value"
Else
  {mysp;1.mystringfield}
0

精彩评论

暂无评论...
验证码 换一张
取 消