I am running SQL Server 2008 R2 with SSRS.
I have some vb code embedded in a simple SSRS report. The column details in my SSRS report returns a value of either 0,2 or 3. Value 2 also seems to change to green each time...
My vb code is there to just change the cell to red, orange or green depending on the number in the cell. It works for 0 and for 3 but not for number 2 for some arbitrary reason....
My code is as follows:
Public Shared Function GetColor(ByVal value as Int32) As String
If value = 0 Then
return “Green"
ElseIf value = 2 Then
return "White"
Else
return "Red"
End IF
End Function
I then reference this using an expression for background color of the cell. With the following code:
=Code.GetColor(Fields!status.Value)
Please let me know if additional info is needed.