Print Page | Close Window

Highlight Field

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=8979
Printed Date: 04 May 2024 at 1:56pm


Topic: Highlight Field
Posted By: stefshuuj
Subject: Highlight Field
Date Posted: 28 Jan 2010 at 3:29pm
Hello all,

Hopefully someone has the answer to this one.

I am using Crystal Reports 2008.

I need to be able to highlight a field if the date a job was despatched is greater then the day it was meant to be.

So if "Despatch Date Field" is greater then "Due Date Field" highlight "Despatch Date Field"

Thanks in advance for any help

Cheers
Stephen


-------------
Thanks in Advance
Stephen
"CR Newbie"



Replies:
Posted By: davejwhite
Date Posted: 29 Jan 2010 at 12:54am
Hi there,
 
Simple (when you know how!!).
 
1. Right click the field you want to highlight and select Format Field
2. Go to the Border tab
3. Click the x2  button to the right of the Background property. This opens the Formula Editor. You have to create the expression for which you want the property to be used
4. Build
 
If {Despatch Date Field}  >  {Due Date Field} Then
    crYellow
Else
    crNoColor
 
Notes:
1. You can use whatever colour you want instead of crYellow, but it has to be a Crystal reports constant. If you want non-regular colours, you can use the Color function, which takes three arguments all between 0 and 255. This determines the Red, Green, Blue factors in the colour
 
2. You must stipulate crNoColor in the Else part - otherwise everything goes black - that's the default colour in an expression like this.
 
Good luck!


Posted By: davejwhite
Date Posted: 29 Jan 2010 at 12:56am
PS. If you want a colour highlight behind the whole Detail line, do the above on the Background Colour of the Detail section in the Section Expert


Posted By: stefshuuj
Date Posted: 01 Feb 2010 at 3:45pm
Thanks Alot for that.
 
Was odd. Even though I put crYellow, I didnt highlight yelllow. Instead it highlighted silver because the dropdown box was still silver.
 
Changed the dropdown to yellow and it worked.
 
Cheers


-------------
Thanks in Advance
Stephen
"CR Newbie"



Print Page | Close Window