Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Custom font color is being overridden Post Reply Post New Topic
Author Message
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet Topic: Custom font color is being overridden
    Posted: 05 May 2016 at 6:58am
I am using Crystal Reports 2011. 

I have a formula, @Classification,  that has four possible results:
First
Expanded
Reserve
Quarantine

I want the font color to change based on the result of that formula.  Since orange is not available as a conditional formatting color, I have set the font color of the field to orange and then applied conditional formatting.

If {@Classification} = 'First'
then crGreen
else
if {@Classification} = 'Expanded'
then crBlue
else
if {@Classification} = 'Reserve'
then crBlack

The problem I am encountering is that once I apply the conditional formatting, 'Quarantine' is no longer orange.  It changes back to black.  But the colors of the other classifications are correct.

How can I resolve this?
IP IP Logged
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet Posted: 05 May 2016 at 7:01am
Right after I posted this question, I found the answer.  I needed to correct the conditional formatting formula by adding 'DefaultAttribute':
If {@Classification} = 'First'
then crGreen
else
if {@Classification} = 'Expanded'
then crBlue
else
if {@Classification} = 'Reserve'
then crBlack
else DefaultAttribute
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 May 2016 at 8:50am
as an FYI you can use the color(r,g,b) to set any color value you want and not be limited
e.g.
if {@Classification} = 'Quarantine'
then color(255,165,0)
IP IP Logged
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet Posted: 05 May 2016 at 11:12am
Thank you!  I did not know that.
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.016 seconds.