empty field
Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21700
Printed Date: 29 Apr 2024 at 5:19am
Topic: empty field
Posted By: HAWKEYE
Subject: empty field
Date 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
|
Replies:
Posted By: praveeng
Date 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
|
Posted By: DBlank
Date Posted: 28 Sep 2015 at 6:50am
You may also have to replace the NULL fields with empty strings
|
Posted By: HAWKEYE
Date 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.
|
Posted By: HAWKEYE
Date 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.
|
Posted By: HAWKEYE
Date 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.
|
Posted By: DBlank
Date 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
|
Posted By: HAWKEYE
Date Posted: 29 Sep 2015 at 1:06pm
Ok I will work on that thank you.
|
|