Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Colour a field dependingon value in another field Post Reply Post New Topic
Author Message
aled_l_d
Newbie
Newbie


Joined: 15 Mar 2011
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote aled_l_d Replybullet Topic: Colour a field dependingon value in another field
    Posted: 02 Oct 2013 at 11:52pm
Hi,
I am trying to change the background colour of a field if a value in a different field is met.
 
So.....
Field 1 should change to green where Filed 2 = ABC
 
Any suggestions fwould be great.
 
Thanks in advance
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 03 Oct 2013 at 2:10am
Go to format field, tab Border. Next to background, click on the X-2 button, and create a formula like
if {Field2} = 'ABC' then crGreen

The different colors are listed there, if you want another color use color(222,222,222) instead of crGreen
(change 222,222,222 with the color code you need, this is grey)
IP IP Logged
aled_l_d
Newbie
Newbie


Joined: 15 Mar 2011
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote aled_l_d Replybullet Posted: 03 Oct 2013 at 2:32am
I am using this formula but the headings don't change
if {SIHE_TRANSCRIPT.MITIGATE_ID} = 'MITA' then
crRed
else crNoColor
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 03 Oct 2013 at 2:36am
And it doesn't change? I am trying that exact formula myself, and it seems to work. What is the output from {SIHE_TRANSCRIPT.MITTAGE_ID}, if you put it in the report?
IP IP Logged
aled_l_d
Newbie
Newbie


Joined: 15 Mar 2011
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote aled_l_d Replybullet Posted: 03 Oct 2013 at 2:56am
The output from {SIHE_TRANSCRIPT.MITIGATE_ID} is MITA. I have even tried saying like '%MI%' but still nothing. Does it make a difference if i'm using a cross tab?
IP IP Logged
aled_l_d
Newbie
Newbie


Joined: 15 Mar 2011
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote aled_l_d Replybullet Posted: 03 Oct 2013 at 3:01am
I can colour the MITIGATE_ID field using the code
 
if CurrentFieldValue = 'MITA' then
crRed
else
crNoColor
 
but not another field
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Oct 2013 at 3:03am
try searching for "GridRowColumnValue"
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.031 seconds.