Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Image Suppression and Null Handling Post Reply Post New Topic
Author Message
coffeedrinker22
Newbie
Newbie


Joined: 25 Oct 2012
Online Status: Offline
Posts: 4
Quote coffeedrinker22 Replybullet Topic: Image Suppression and Null Handling
    Posted: 25 Oct 2012 at 10:08am
Alright so I have a report where I'm doing conditional image suppression based on a field in one of my tables. We'll call the images 'T' and 'L'. They are also the values in the field.

I want image T suppressed when my field is equal to L. I want image L suppressed when my field is equal to T or my field is null (so essentially unless my field is equal to L, display T). I have it set up so they work oppositely right now.

On image T, the conditional formula looks like this:
field="L"

On image L, the conditional formula looks like this:
field<>"T"

When I try to add in an exception to take care of the null scenario, it breaks. I've tried adding field<>'NULL' to the T conditional and isnull(field) to the L conditional and neither work.

Any help? Thanks.
IP IP Logged
comatt1
Senior Member
Senior Member
Avatar

Joined: 19 May 2011
Online Status: Offline
Posts: 337
Quote comatt1 Replybullet Posted: 25 Oct 2012 at 10:32am
see if u can make it work within options in toolbar -> report-> reading data - > uncheck convert database null values to default and convert other null values to default. Default probably is = '' not null.

or evaluate len of field, crystal can make data empty as opposed to null, try if len(field)=0 as opposed to null
IP IP Logged
coffeedrinker22
Newbie
Newbie


Joined: 25 Oct 2012
Online Status: Offline
Posts: 4
Quote coffeedrinker22 Replybullet Posted: 25 Oct 2012 at 10:47am
Convert null values was already unchecked, and I tried evaluating the length of the field and neither worked (although both were great ideas). =/

I should also mention that there are other options for the values in the field (A, B and C) but those should all display the 'T' image. When the field value is one of these other options, it displays no image either, so it's not just the null exception that's throwing it off.
IP IP Logged
coffeedrinker22
Newbie
Newbie


Joined: 25 Oct 2012
Online Status: Offline
Posts: 4
Quote coffeedrinker22 Replybullet Posted: 26 Oct 2012 at 3:22am
Ended up having to just take out the nulls in SQL using isnull(). thanks for the response!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 26 Oct 2012 at 4:55am
Your other option would have been to set up your formula to explicitly check for null, something like this:
 
IsNull({field}) or {field} <> 'T'
 
Nulls require special handling when doing comparisons - anything compared to Null is Null.  So, for example, your {field} <> 'T' does NOT return false when {field} is null, it returns {null}.  That's why you have to explicitly test for null and you need to do that check BEFORE you check for a value or it won't work correctly.
 
-Dell
IP IP Logged
coffeedrinker22
Newbie
Newbie


Joined: 25 Oct 2012
Online Status: Offline
Posts: 4
Quote coffeedrinker22 Replybullet Posted: 26 Oct 2012 at 4:59am
ahhh, that's definitely what my problem was, I was checking for null after my other criteria. thanks!!
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.