Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: how can i change text color based on result value Post Reply Post New Topic
Author Message
ji_stan
Newbie
Newbie


Joined: 30 Mar 2008
Location: Australia
Online Status: Offline
Posts: 1
Quote ji_stan Replybullet Topic: how can i change text color based on result value
    Posted: 30 Mar 2008 at 5:04am

hi
how can i write a formulae that changes the color of the text based on the value. ie, results from a database return values of sales made this week.
example: teddy bears: Mon   Tue   Wed  Thurs
____________________5___3____1____0
__________barbie dolls:4____2____2____1

how can i change the color of the numbers to RED if they are 2 or lower on the report?   so if in case of teddy bears,wed & thurs results would be in Red, mon and tue in default black.

anyone know how to go about doing this?
cheers.

gg
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 30 Mar 2008 at 1:34pm
This is pretty easy and I give lots of examples of conditional formatting of reports in my Encyclopedia book. On the report object, right-click on it and select Format Object. Find the property you want to modify (Font tab, Color) and click on the Formula Workshop button to the right (it has a pencil on it). Then enter something like the following formula:
if {table.salesfield}<=2 then
    crRed
else
   DefaultAttribute;

You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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.