user3266144
user3266144

Reputation: 15

SSRS 2008 Background colour based on values

I am trying to use this expression to change the background colour of a text box within SSRS 2008

=IIF(Fields!Score.Value  <=12, "Green", IIF(Fields!Score.Value  >=13, "Amber"  , IIF(Fields!Score.Value  >=19, "Red"  ,"White")))

The result is 15 which should pull back an amber colour which it is not doing.

The thresholds for the score field are

High 19-24 Medium 13-18 Low < 12

Upvotes: 0

Views: 640

Answers (2)

The General
The General

Reputation: 106

Assuming 'Score' is an INT you just need to swap the tests for >= 13 and >=19 as follows:

=IIF(Fields!Score.Value  <=12, "Green", IIF(Fields!Score.Value  >=19, "Red"  , IIF(Fields!Score.Value  >=13, "Orange"  ,"White")))

Also 'Amber' isn't a valid colour name so change that to something like 'Orange' too.

Upvotes: 0

Naveen Kumar
Naveen Kumar

Reputation: 1541

Try to convert field value to INT, Might be expression considering this as string

=IIF(CInt(Fields!Score.Value) <=12, "Green", IIF(CInt(Fields!Score.Value) >=13, "Amber"  , IIF(CInt(Fields!Score.Value) >=19, "Red"  ,"White")))

Upvotes: 1

Related Questions