Reporting Services Conditional Row Color
I have a report that shows client names jsut in a list like so:
ATK
FLD
FLD
DB
DB
DB
BL
I already have them grouped and everything but I am wondering if there is a way to make it so I can have each client seperated by color, for example white then grey then white then grey etc.
Right now I am using background color as the following:
=IIF(RowNumber(Nothing) Mod 2,"Gainsboro","White")
This just makes every other row white or grey. Is there a way to make e开发者_如何学Pythonvery other client white or grey?
In the custom code for the report add the following:-
Public shared currentRowColour as string = "Red"
public function GetBackGroundColour(previousValue as string, currentValue as string) as string
if previousValue <> currentValue then
if currentRowColour = "Red" then
currentRowColour ="Orange"
else
currentRowColour ="Red"
end if
end if
return currentRowColour
end function
Then edit the expression for the background colour for your text box (or row) =Code.GetBackGroundColour(Previous(Fields!.Value), Fields!.Value)
精彩评论