Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula syntax Post Reply Post New Topic
Author Message
jessecar
Newbie
Newbie


Joined: 07 Apr 2009
Online Status: Offline
Posts: 3
Quote jessecar Replybullet Topic: Formula syntax
     Posted: 24 Aug 2009 at 9:45am

We have a form report that has checkboxes. I created a crystal report to print that form. I have found part of the syntax for displaying a box with no check if value in field =0, and if the value in field =1 to display a box with a check (using wingdings font). The report runs fine but when it runs into a value of null it does not do anything. I would like it to display a box with no check when a null is encountered. Below is what works for checked and unchecked but will no display anything if value is null. What am i missing? Can this be done? Is ther an easier way to do this? Any information will be greatly appreciated.

chr (168) = box with no check
chr (254) =box with check
 
Syntax 1
If ({field})=1 Then (chr (254))
Else
If ({field})=0 Then (chr (168))
 
 
Below will work but some of these field have default values set to False which shows up as a 0, so it displays a box with a check as I told it to do so indicated by the else chr (254).
 
Syntax 2
If IsNull({field})
Then
chr(168)
Else
chr (254)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Aug 2009 at 9:57am
If IsNull({field}) or {field}=0 Then chr (168)
Else
chr (254)
 
IP IP Logged
jessecar
Newbie
Newbie


Joined: 07 Apr 2009
Online Status: Offline
Posts: 3
Quote jessecar Replybullet Posted: 24 Aug 2009 at 10:16am
Thank you for your help and input. It works great.
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