Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula Fields and Text Colors Post Reply Post New Topic
Author Message
adavis
Senior Member
Senior Member


Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Quote adavis Replybullet Topic: Formula Fields and Text Colors
    Posted: 16 Nov 2012 at 5:22am
This is probably addressed somewhere in the forums, but I have not yet perfected how to search effectively in here, so if my question is a common one, feel free to direct me to the appropriate threads.

I have a simple formula field that subtracts the value of one field from another. I would like for the text of the formula field to be red when it is a negative value.

As always, your input is very much appreciated!



Edit: BTW, I have tried using
if (formula) < 1
then red
else black

I couldn't keep the formula and the if/then/else statement together in one formula field. It changed all my values to zero.

Edited by adavis - 16 Nov 2012 at 5:30am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Nov 2012 at 5:30am

right click on the field

select format field
find the text color formula
use
if currentfieldvalue <0 then crred else crblack
IP IP Logged
shanth
Groupie
Groupie


Joined: 06 Aug 2012
Location: United States
Online Status: Offline
Posts: 75
Quote shanth Replybullet Posted: 16 Nov 2012 at 5:32am
Right Click on the Field/ Formula you want to format-> Select Format Field->Font Tab->Click X-2 Box Next to color-> Write Condition Accordingly:
if {Field}<0 then crRed
IP IP Logged
adavis
Senior Member
Senior Member


Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Quote adavis Replybullet Posted: 16 Nov 2012 at 5:38am
So simple. Thank you DBlank and shanth!

I was making it a lot more complicated than I needed to.
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.061 seconds.