crystal report color based on conditions

How to add colors to crystal report based on multiple conditions
For example, Show the report cells in Green when meets this condition:
{Customer.Last Year’s Sales} < 50000 and {Customer.Status} = ‘OPEN’


Cristina (BOB member since 2009-02-27)

Hi,

If you want to show each cell based on this condition.
Right click on field->format field->border->background->x-2->
then write this

if {Customer.Last Year’s Sales} < 50000 and {Customer.Status} = ‘OPEN’
then crgreen else defaultattribute

If the formula is same for all fields then use format painter to apply same color for all the fields


vissubabu (BOB member since 2012-09-12)

Thx,but how to get highlighted cell when the cell is null
The below is not working, please let me know is there any way to fix
cstr({Command.SALE_NUMBER}) = " "


Cristina (BOB member since 2009-02-27)

Maybe you can do a len function on a string. Try this: len(cstr({Command.SALE_NUMBER})) = 0


kevlray :us: (BOB member since 2010-06-23)

Thx, but does not help
Even i tried this: IsNull({Command.SALE_NUMBER})
:hb:


Cristina (BOB member since 2009-02-27)

I did some testing (with a string field). I found out that I could not get anything to work correctly unless I replaced the field with a formula that placed the null field with a string (single blank), like this:
if len({somefield}) = 0 then " " else {somefield}


kevlray :us: (BOB member since 2010-06-23)

yes, Thanks
However, i am running into 1 more issue with this color highlighting
How to keep alternate row color as well these formulas in 1 place
I know we do alternate row color in section expert>color>details
How to keep it together?
If not, is there any place where I can have both?


Cristina (BOB member since 2009-02-27)

Don’t know, I have not tried to mix the two before.


kevlray :us: (BOB member since 2010-06-23)