SRSS if / else SWITCH

时间:2016-06-22 11:10:00

标签: sql-server-2008 reporting-services ssrs-expression

我有一个条形图,我希望每个类别都有不同的颜色。

到目前为止,我正在使用SWITCH进行此操作,但我无法看到如何将其他内容放在那里。

我的代码如下所示:

    =SWITCH(
Fields!Style_Name.Value = "Vagabond Pale Ale", "CornflowerBlue",
Fields!Style_Name.Value = "This Is Lager", "Orange", 
Fields!Style_Name.Value = "Punk IPA", "#00AFDB", 
Fields!Style_Name.Value = "Nanny State", "White", 
Fields!Style_Name.Value = "Jet Black Heart", "DimGray", 
Fields!Style_Name.Value = "Dead Pony Club", "SeaGreen", 
Fields!Style_Name.Value = "5am Red Ale", "Maroon", 
Fields!Style_Name.Value = "KingPin", "Orange", 
Fields!Style_Name.Value = "Jack Hammer", "LimeGreen",  
Fields!Style_Name.Value = "Libertine Black Ale","#7e000000", 
Fields!Style_Name.Value = "Hardcore IPA","MidnightBlue", 
Fields!Style_Name.Value = "Cocoa Psycho", "Indigo", 
Fields!Style_Name.Value = "Elvis Juice", "Red")

1 个答案:

答案 0 :(得分:0)

最后添加     是的,“Yourcolor”

record rule