Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Highlighting NULL values Post Reply Post New Topic
Author Message
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Topic: Highlighting NULL values
    Posted: 22 Jun 2010 at 4:15am
I have a date field where I would like to highlight NULL values. The Highlighting Expert doesn't have this option. Is there another way to do this?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 22 Jun 2010 at 4:31am

In the 'Font' and 'Border' tabs of the 'Format Editor', there is a place to enter a formula for the color (among other things).  You can create a formula that checks for a null value.

 
I hope this helps.
IP IP Logged
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Posted: 22 Jun 2010 at 4:49am
any suggestions on what to write for the formula?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Jun 2010 at 5:27am
You cannot highlight NULL records as there is nothing to highlight. You will need to insert a value using a formula and then conditionally highlight it. Easisest way is to convert it to a string and then highlight using the string value you insert for NULLS. Here is a sample.
if isnull(table.date) then 'Missing' else totext(table.date,'MM/dd/yyyy')
IP IP Logged
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Posted: 22 Jun 2010 at 6:06am
Thanks for the suggestions. I'm still having a problem with the formula though. I was getting error messages with this formula:
 
if isnull(tblGrantRevisit.SubmittedToPandC) then 'Missing' else totext(tblGrantRevisit.SubmittedToPandC,'MM/dd/yyyy')
 
Until I changed it to this formula:
 
if isnull ({tblGrantRevisit.SubmittedToPandC}) then 'Missing' else totext ({tblGrantRevisit.SubmittedToPandC},'MM/dd/yyyy')
 
Now, instead of the NULL values showing 'Missing', there's a date displayed as 12/31/-4714.
 
Not sure how it's coming up with that date?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Jun 2010 at 6:10am
Yes you need the brackets around the fields...
 
Do you have it set to insert default values for NULLs (either at the report options level or the formula level)?
IP IP Logged
jgarner
Senior Member
Senior Member


Joined: 23 Jan 2009
Location: United States
Online Status: Offline
Posts: 159
Quote jgarner Replybullet Posted: 22 Jun 2010 at 6:15am
That was it! Once I unchecked those boxes, it worked as you suggested. Thanks again.
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.035 seconds.