I want to change the color of the text in text object using formula in Crystal Report.
I tried like
If {mnth_ttx.weight}>0 Then
crRed;
But the color is not changing at run time.
I wrote this condition under formula edit of weight text object. But not working.
How to change the color of a text using formula
You can create a more advanced format using html
First text field need to set the TextFormat property as crHTMLText
With this the text field will interpret the html after being assigned in the formula you can put the following
if {?PARAMETER}=3 then
If not IsNull ({TABLE.FIELD1}) Then
"<p><b><font color='#00559c'>" & {TABLE2.FIELD1} & "</font></b></p>" & {TABLE2.FIELD2} & ": " & {TABLE2.FIELD2}
Else
"<p><b><font color='#00559c'>" & {TABLE2.FIELD1} & "</font></b></p>"
if x> 0 then
formula= color(159,255,159)
else
formula = crRed
end if
'The values in the color(159,255,159) are color(red, green, blue). These are the numbers that you will see when you create a custom color.
Right click field
1. Select format object
2. Goto Border
3. Select Background Colorado
4. Click OK.
That's it. You are done!