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
In Crystal Reports, right click on a text object or database field, and select "Format..." In the "Format Editor", under the tab "Border", check the option "Background", and select a color.
To write a conditional formatting formula, right-click the report and click Format Result Object element → select the property on which you want to apply conditional formula → click and it will open formula workshop. Write the formula in the formula text pane, save and close it.
To insert special fields in Crystal Reports, click the small plus sign next to the “Special Fields” entry within the “Field Explorer” pane. Click the name of the special field that you want to insert into the report and then click the “Insert to Report” button in the toolbar of the “Field Explorer” pane.
Follow these steps:
Format Field...
Font
tab, then click conditional-formula
button to the right of the color pickerIf {mnth_ttx.weight}>0 Then crRed Else crBlack
Follow these steps:
Enter this formula:
If {mnth_ttx.weight}>0
Then crRed
Else crBlack
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With