SSRS Custom Colour does not want to work

时间:2016-12-09 13:02:03

标签: sql reporting-services charts

I have custom colors that I am applying to my SSRS Doughnut Chart.

Only thing is its not applying the colors specified. As far as I can see it just uses default.

Am I missing a setting or something?

I am applying it at Series Properties > Fill > (Style = Solid) > Color Expression as Follow:

=Switch(Fields!WCode.Value = 102, "Aqua",
        Fields!WCode.Value = 103, "Red",
        Fields!WCode.Value = 104, "Yellow",
        Fields!WCode.Value = 105, "LightGrey",
        Fields!WCode.Value = 106, "Purple",
        Fields!WCode.Value = 107, "HotPink",
        Fields!WCode.Value = 108, "Maroon",
        Fields!WCode.Value = 109, "Khaki",
        Fields!WCode.Value = 110, "DarkOliveGreen",
        Fields!WCode.Value = 111, "Plum",
        Fields!WCode.Value = 113, "Pink",
        Fields!WCode.Value = 117, "Lime",
        Fields!WCode.Value = 118, "Orange",
         "White")

I have cleaned the solution also deleted the project data file in the project folder.

I am at a loss and your assistance will be appreciated.

1 个答案:

答案 0 :(得分:1)

Try:

=Switch(Fields!WCode.Value = 102, "Aqua",
        Fields!WCode.Value = 103, "Red",
        Fields!WCode.Value = 104, "Yellow",
        Fields!WCode.Value = 105, "LightGrey",
        Fields!WCode.Value = 106, "Purple",
        Fields!WCode.Value = 107, "HotPink",
        Fields!WCode.Value = 108, "Maroon",
        Fields!WCode.Value = 109, "Khaki",
        Fields!WCode.Value = 110, "DarkOliveGreen",
        Fields!WCode.Value = 111, "Plum",
        Fields!WCode.Value = 113, "Pink",
        Fields!WCode.Value = 117, "Lime",
        Fields!WCode.Value = 118, "Orange",
        true,"White")

Let me know if this helps.