Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Display null values in Formula Post Reply Post New Topic
Author Message
Mailman
Newbie
Newbie
Avatar

Joined: 21 Apr 2008
Location: United Kingdom
Online Status: Offline
Posts: 12
Quote Mailman Replybullet Topic: Display null values in Formula
     Posted: 22 Apr 2008 at 8:35am
Hi I am trying to diplay Null values as data missing in a formula I can pick up the other values okay but when it comes to a null value the formula doesn't populate the field . Does any body know when assigning variables to fields does the IsNull construct work .Below is a description of what I am trying to do.
 
Local StringVar CourseType;
Local StringVar FundSource;
 
CourseType := {stcfesdt.course_type};
Fundsource := {stcfesdt.fund_source};
 
if IsNull({stcfesdt.fund_source})
then "D M"
else if CourseType = "99" and FundSource = "02"
then FundSource
else if CourseType = "06" and FundSource = "11"
then FundSource
else if CourseType = "20" and FundSource = "02"
then FundSource
else if CourseType = "18" and FundSource = "02"
then FundSource
else if CourseType = "10" and FundSource = "11"
then FundSource
else "Err"
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 23 Apr 2008 at 8:20am
Try this:
Local StringVar CourseType;
Local StringVar FundSource;
 
if IsNull({stcfesdt.course_type}) then
  CourseType = " ";
else
  CourseType := {stcfesdt.course_type};
 
if IsNull({stcfesdt.fund_source}) then
  Fundsource := " ";
else
  Fundsource := {stcfesdt.fund_source};
 
if IsNull({stcfesdt.fund_source})
then "D M"
else if CourseType = "99" and FundSource = "02"
then FundSource
else if CourseType = "06" and FundSource = "11"
then FundSource
else if CourseType = "20" and FundSource = "02"
then FundSource
else if CourseType = "18" and FundSource = "02"
then FundSource
else if CourseType = "10" and FundSource = "11"
then FundSource
else "Err"
IP IP Logged
Mailman
Newbie
Newbie
Avatar

Joined: 21 Apr 2008
Location: United Kingdom
Online Status: Offline
Posts: 12
Quote Mailman Replybullet Posted: 23 Apr 2008 at 8:58am
Hi this worked had to remove a couple of ; in the if statement (when assign values to the variables) as it caused the formula content not to be recognised .Works great many thanks .
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