Jeff
Jeff

Reputation: 11

Crystal Reports - Error when checking the value of a boolean field in a formula

I have a simple formula that displays a checkmark if a boolean is not null and true, otherwise displays nothing. This formula works on most of my report, but there is one section where it gives me very odd errors. My formula is:

if(NOT(ISNULL({RoadCalls.SteerDeepBool})) AND {RoadCalls.SteerDeepBool})
then
Chr(252)
else
Chr(32)

I've narrowed the issue down to the AND {RoadCalls.SteerDeepBool} part. When the formula is written as it is above, the error given is 'Error in formula Display_String.... A boolean is required here' However, when I change the comparison to AND {RoadCalls.SteerDeepBool}=true, I get 'Error in formula Display_String.... A string is required here'.

As I mentioned, this exact formula works with other variables in other sections of the report. It does not work with 5 variables, all in the same table, all with unique names, all of type boolean. Is there anything I'm missing here?

Upvotes: 0

Views: 107

Answers (1)

MilletSoftware
MilletSoftware

Reputation: 4026

Please change to:

IF ISNULL({RoadCalls.SteerDeepBool}) Then Chr(32) ELSE 
IF {RoadCalls.SteerDeepBool} THEN Chr(252) ELSE Chr(32)

Upvotes: 0

Related Questions