Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Formatting 1

Status
Not open for further replies.

RachelK

Programmer
Mar 18, 2002
171
GB
I would like to use the condition formating function to change colur of text when greater than 0 does anyone know how I know rgb colour numbers ie what number to use for red ect ?
 
When you say where text is greater than 0, I'm assuming you mean that you want to exercise this function on a numerical field.

If so, there are a couple of ways available to you.

If you're using Crystal 8.5, you can right click the field, and select the Highlight Expert, which enables you to specify what colours to attribute to a field depending on the value returned.

If you're using an earlier version of Crystal, you should right click the field, select Format, Font, and hit the x2 Conditional Formula button next to Color.

Then type: if {Your.Field} > 0 then red

You don't need to use numbers to refer to colours in Crystal. But, for the record, I think red is 255. Crystal recognises either format.
 
I agree with Naith except I think the formula should be

if {Your.Field} > 0 then crRed else crBlack

if Black is your normal colour... Jim Broadbent
 
CR has a color chart that shows the RGB Value for any color. To use it you have to open a chart (any chart will do) in the Analyzer and select a single slice or a bar.

Then you:

1) Use the color selector on the left of the Analyzer tool bar.
2) Select "MORE" in the color drop down.
3) Click anywhere in the rainbow to select a color
4) Check the color in the "Color Solid" window
5) Copy the RGB values from the lower right boxes. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top