Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: empty field Post Reply Post New Topic
Author Message
HAWKEYE
Newbie
Newbie


Joined: 19 Sep 2015
Online Status: Offline
Posts: 7
Quote HAWKEYE Replybullet Topic: empty field
    Posted: 26 Sep 2015 at 6:02am
When there is an empty field in CR. need it to highlight in red, what is the syntax for a field that is empty this is what I have

if currentfieldvalue="tom" then
craqua
else if currentfieldvalue="sallie" then
craqua
else if currentfieldvalue="" then
crred

Ant help would be appreciated
IP IP Logged
praveeng
Senior Member
Senior Member
Avatar

Joined: 11 Jul 2011
Online Status: Offline
Posts: 165
Quote praveeng Replybullet Posted: 27 Sep 2015 at 11:26pm
Hi,

Use below logic:

if currentfieldvalue in ["tom","sallie"] then
craqua

else if (currentfieldvalue="" or IsNull(currentfieldvalue)) then
crred


--Praveen G
Praveen Guntuka,
praveen_guntuka@yahoo.com
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Sep 2015 at 6:50am
You may also have to replace the NULL fields with empty strings
IP IP Logged
HAWKEYE
Newbie
Newbie


Joined: 19 Sep 2015
Online Status: Offline
Posts: 7
Quote HAWKEYE Replybullet Posted: 28 Sep 2015 at 11:23am
Thanks for the assistance when I type in the code its telling me a field is required, where I have it in bold.
else if (currentfieldvalue="" or IsNull(currentfieldvalue)) then
crred.
IP IP Logged
HAWKEYE
Newbie
Newbie


Joined: 19 Sep 2015
Online Status: Offline
Posts: 7
Quote HAWKEYE Replybullet Posted: 28 Sep 2015 at 11:24am
Thanks for the assistance when I type in the code its telling me a field is required, where I have it in bold.
else if (currentfieldvalue="" or IsNull(currentfieldvalue)) then
crred.
IP IP Logged
HAWKEYE
Newbie
Newbie


Joined: 19 Sep 2015
Online Status: Offline
Posts: 7
Quote HAWKEYE Replybullet Posted: 28 Sep 2015 at 11:45am
What do you mean by 
You may also have to replace the NULL fields with empty strings. Sorry for the oddball question have a good day.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Sep 2015 at 5:03am
Null fields cannot be highlighted (back ground color changed).
You may need to create a formula field to use as your display field rather than the original field
example:
if ISNULL(table.field) then "" else table.field

place the above formula field onto the report canvas.
use a conditional background formula on it

if currentfieldvalue in ["tom","sallie"] then
craqua
else if currentfieldvalue="" then crred
else crnocolor
IP IP Logged
HAWKEYE
Newbie
Newbie


Joined: 19 Sep 2015
Online Status: Offline
Posts: 7
Quote HAWKEYE Replybullet Posted: 29 Sep 2015 at 1:06pm
Ok I will work on that thank you.
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.047 seconds.