Reputation: 4418
I am using this expression to get alternative colors for my row group:
=iif(RunningValue(Fields!Status_Reason.Value,CountDistinct,Nothing) Mod 2, "LightBlue", "White")
And everything works fine except for some rows:
I am assuming its because of some values are "-", which are 0. What could be the work around in this situation? This is my groups:
Upvotes: 1
Views: 991
Reputation: 10860
I use some VB code for Alternating the row color. It's a little more work to set up at first, but it always works right and you can re-use the code in other reports by copying the VB code.
Expression:
=code.AlternateColor("AliceBlue", "White", 1, 1)
=code.AlternateColor("AliceBlue", "White", 0, 1)
The first column should have the first expression - the first 1 in the argument tells it to change color. The remaining columns use the second expression with the 0 indicating that the color won't change.
VB CODE:
Private bOddRow(10) As Boolean
Function AlternateColor(ByVal OddColor As String, ByVal EvenColor As String, ByVal Toggle As Boolean, ByVal Type AS INTEGER) As String
If Toggle Then bOddRow(Type) = Not bOddRow(Type)
If bOddRow(Type) Then
Return OddColor
Else
Return EvenColor
End If
End Function
If you have multiple levels of grouping in one table, you would change the second number of the expression so the rows are unique for each group. In the below example, the main grouping is colored in white and AliceBlue and the sub group is whitesmoke and a lighter blue.
Upvotes: 3