Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Inserting a Value if Blank Post Reply Post New Topic
Author Message
tdavenport
Groupie
Groupie
Avatar

Joined: 21 Oct 2008
Location: United States
Online Status: Offline
Posts: 41
Quote tdavenport Replybullet Topic: Inserting a Value if Blank
     Posted: 23 Oct 2008 at 10:51am

Newbie here.....

I have a Bar Graph that shows the count on a field. One of the counts is of Blanks (or Null Values). I don't want to suppress this value but I'd like for the name to be "Not Applied" or "N/A"  - anything but an empty space.
 
My guess is that I need to do this on the field or group (and not on the graph itself).
 
So, how do I insert a value into my report whenever is null value is present?
 
Another way of saying this is that I want the label on the bar chart to say "No Data" or "N/A" when the value being counted is blank. There are multiple bars and they all have the name of the value being counted. I want the blanks counted - I just want the Label to say something instead of being blank.
 
Thank you!
 


Edited by tdavenport - 24 Oct 2008 at 9:27am
Any and all suggestions are welcome.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 24 Oct 2008 at 11:10am
You can create a formula that returns the value when it is non-blank, and returns "N/A" when it is blank. Then use this formula in the graph rather than the original field. The formula would be something like this:
if IsNull({table.yourfield}) OR {table.yourfield}="" then
    "N/A"
else
    {table.yourfield};
If you're looking for a great reference on how to use formulas in your reports, my Encyclopedia book has three chapters covering this and it includes a Crystal syntax reference with sample code. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
 
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
tdavenport
Groupie
Groupie
Avatar

Joined: 21 Oct 2008
Location: United States
Online Status: Offline
Posts: 41
Quote tdavenport Replybullet Posted: 24 Oct 2008 at 1:24pm
Brian,
 
As always - Thank you.
Any and all suggestions are welcome.
IP IP Logged
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