Change color of text object using formula in Crystal Reports
83,176
Solution 1
Follow these steps:
- Right click field: select
Format Field...
- Select
Font
tab, then clickconditional-formula
button to the right of the color picker - Enter this formula:
If {mnth_ttx.weight}>0 Then crRed Else crBlack
Solution 2
Follow these steps:
- Right click field: select Format Field.
- select font tab.
- click on the X+2 box directly to the right of the color picker. The Formula Editor will open.
Enter this formula:
If {mnth_ttx.weight}>0 Then crRed Else crBlack
Solution 3
You can use the tried-and-true "currentfieldvalue" evaluation.
Right click on your element and hit "Format Field"
In the Font tab, click on the edit button for "Color".
Enter this:
if currentfieldvalue > 0 then crRed else crBlack
That's all she wrote
Author by
itzArun
Updated on January 09, 2021Comments
-
itzArun over 3 years
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