xorpower
xorpower

Reputation: 18973

Crystal Report: If-Else If Formula

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

Upvotes: 0

Views: 8202

Answers (2)

codingbadger
codingbadger

Reputation: 43984

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}

Upvotes: 2

craig
craig

Reputation: 26262

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

Upvotes: 1

Related Questions