0
votes

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"; 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

2

2 Answers

2
votes

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}
1
votes
IF Isnull({mysp;1.mystringfield}) Then
  "No Value"
Else
  {mysp;1.mystringfield}