Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Print NULL when a field is NULL Post Reply Post New Topic
Author Message
Tupacmoche
Groupie
Groupie
Avatar

Joined: 04 Apr 2007
Online Status: Offline
Posts: 52
Quote Tupacmoche Replybullet Topic: Print NULL when a field is NULL
    Posted: 05 Apr 2007 at 4:08am

I am testing a field to determine if it is NULL or not. Below is an inline if statement
that does this. I also have a select statement that should create a group for NULL
value in this field and print "00 Null Value" in the group header. In both cases
the value for this condition is NOT printed when it evaluates to true. Does anyone
know way this happens? What is the work around?

IIF (isnull({BUDGET_COMMITMENTS.CODE_B}),"NULL" ,{BUDGET_COMMITMENTS.CODE_B} )

Select {BUDGET_COMMITMENTS.CODE_B} [1 to 13]
 Case CStr(IsNULL({BUDGET_COMMITMENTS.CODE_B})):
        "00 Null Value"
    Case "100", "150" :
  "10 Operations"
 Case "200" :
  "20 Direct Expenses"
 Case "210" :
  "21 Sales Promotion"
 Case "220" :
  "22 Sales Administration"
 Case "230" :
  "23 Marketing"
 Case "240" :
  "24 Business Development"
 Case "300" :
  "30 Administrative Expenses"
 Case "350" :
  "35 ERP Implementation Expenses"
 Case "400" :
  "40 Growth Expenses/Research & Development"
 Case "500" :
  "50 Quality"
 Case "600" :
  "60 Regulatory"
 Default :
  "Undefined Group";

Rob
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 05 Apr 2007 at 10:35am

Go to the Report Options on the File menu and make sure that Convert Database NULL Values to Default is not checked.

Also, in your second formula above, you may need to test for Null prior to the Select statement:

If IsNull({BUDGET_COMMITMENTS.CODE_B}) then 

  "00 Null Value"
else
  Select...
 
Nulls are handled differently than other types of values and you always have to deal with them using an IsNull before you do any other types of comparisons.
 
-Dell
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.063 seconds.