Wednesday, March 7, 2012

conditional formatting in reporting services (2005)

I am new to reporting services and am unable to get cell colouring conditional formatting to work in of a report. Basically I need to have the following:

>-5% = "Red"

Between -5% and -1% = "Green"

0% = "White"

Between 1% and 5% = "Green"

>5% = "Red"

Here is what I have tried to use:

=iif((Fields!TrueUpPercQ1.Value >0 and

Fields!TrueUpPercQ1.Value <=0.05) or (Fields!TrueUpPercQ1.Value < 0 and

Fields!TrueUpPercQ1.Value >=-0.05), "Green",

iif(Fields!TrueUpPercQ1.Value =0, "White","Red"))

Any ideas?

Thanks

Try this....

=iif((Fields!TrueUpPercQ1.Value > 0, "Red", IIF(Fields!TrueUpPercQ1.Value <=0.05, "Red", IIF(Fields!TrueUpPercQ1.Value < 0, "Blue,

IIF(Fields!TrueUpPercQ1.Value >=-0.05, "Green", iif(Fields!TrueUpPercQ1.Value =0, "White","Red")))))

You may want to tweak this to suit your need. Also make sure the number of closing brackets are correct. This is the way the IIF is used. Hope it helps. Let me know.

|||

Iif would work, but I think switch would be better

Try this...you have to have even number of arguments for it to work correctly. The first is your statement to evaluate to true then the second argument is executed, if false it proceeds to the next (3rd) argument until something evaluates as true.

=SWITCH(Fields!TrueUpPercQ1.Value <=0.05, "Red", Fields!TrueUpPercQ1.Value < 0, "Green", Fields!TrueUpPercQ1.Value =0, "White")

1 2 3 4 5 6

|||

Iif would work, but I think switch would be better

Try this...you have to have even number of arguments for it to work correctly. The first is your statement to evaluate to true then the second argument is executed, if false it proceeds to the next (3rd) argument until something evaluates as true.

=SWITCH(Fields!TrueUpPercQ1.Value <=0.05, "Red", Fields!TrueUpPercQ1.Value < 0, "Green", Fields!TrueUpPercQ1.Value =0, "White")

No comments:

Post a Comment