SSRS: Get backgroundcolor from Cell

前端 未结 3 1168
孤独总比滥情好
孤独总比滥情好 2021-01-23 09:51

I\'ve got a report as a table. I would like to set for each column a random backgroundcolor.

For this i created a Custom Script:

Public Function GetColor         


        
3条回答
  •  旧巷少年郎
    2021-01-23 10:18

    @Chris Thank you this is what i needed. Because my Columns were dynamic I had to write another function to get a Number:

    Public Function GetColumnNumber(ByVal parameter as Parameter,ByVal SSID As String) as String
          For i as integer = 0 to parameter.Count-1
             If CStr(parameter.Value(i)) = SSID THEN
              Return i
             END IF
          Next
    End Function
    

    In the Cell i wrote this:

    =code.GetColor(code.GetColumnNumber(Parameters!SSID,Fields!SSID.Value))
    

    Thanks again :)

提交回复
热议问题