1
votes

Afternoon all,

I have a simple bar graph in SSRS 2005. I wish to apply some conditional formatting to this bar graph but i am unable to get this working.

I believe that i should be able to add formmatting within the 'Chart Properties --> 'Data' tab --> 'Values' section? I have added the following code to the Expression editer but this doesnt work. when i preview the report it shows the bar graph colour as green as this is the default pallette?

=IIF(fields!Value.Value <=129, "blue", "yellow")

I have also tried to add this to the 'Format' property of the chart but i am still unable to see this formatting.

Am i missing something? Can anyone suggest a working solution or another method?

Regards Betty

1

1 Answers

2
votes

Should work OK? I replicated by setting an expression under Data Field -> Properties -> Appearance -> Series Style -> Fill -> Color.

=IIf(Fields!val.Value < 150, "Red", "Blue")

So something like:

enter image description here

Final result:

enter image description here

Only other consideration is that, depending on your underlying data, you might need an aggregate in the expression:

=IIf(Sum(Fields!val.Value) < 150, "Red", "Blue")

But you can see that it should be possible.