Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change color of the font based on the thresh hold value

I have a requirement like if the the threshhold value is greater than 6% the text color should appear as red and between 5-6% it should change to yellow. I tried this expression in the text box font color property for the first requirement iif(fields!My_column.value>6, "red","Black") but did not work. I would appreciate any tips for both of my problems. Thanks

like image 513
poshak Avatar asked Jan 14 '23 05:01

poshak


1 Answers

No reason this shouldn't be working.

You can set the Color property for a Text Box and it should be fine.

=Switch(Fields!My_column.Value > 6, "Red"
    , Fields!My_column.Value < 5, "Black"
    , true , "Yellow")

Gives:

enter image description here

How does your underlying data look? Is 6% "6" or is it actually "0.06"?

like image 87
Ian Preston Avatar answered Jan 30 '23 23:01

Ian Preston