Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 575
  • Last Modified:

How to set alternating background colors in Reporting Services?

I'm having row data in matrix with groups. I'm using the following expression to change the background color of alternate rows.

=IIf( RunningValue (Fields!FieldName, CountDistinct, Nothing) MOD 2, Color1, Color2)

The above expression works fine when it is used in matrix with groups also but when the calculation field is not zero. If calcuation field is zero it is getting wrong colours. I'm also having dummy values for the fields that are not having actual values. Those values are hidden from the report. Any help on this would be appreciated. Thanks ActualData
0
JRevathi
Asked:
JRevathi
3 Solutions
 
sammySeltzerCommented:
= IIf(RowNumber(Nothing) Mod 2 = 0, "Color1", "Color2")
0
 
planoczCommented:
Here's a couple of examples that might help you in your search:

Change font color when looking for a special  condestion
Place this code in your code tab window of the report.
 Public Function CheckForInactive(ByVal Str As String) As Boolean
        If InStr(UCase(Trim(Str)), UCase("inactive")) > 0 Then
            Return True
        End If
        Return False
    End Function

Then place this code in each textbox color properties that you are checking for inactive
=IIF(code.CheckForInactive(Fields!MyTextbox.Value)=True,"Red","Black")
*--------------------------------------------------------------------------------------------------*
Color Rows in detail fields
Background .... =IIF(RowNumber(Nothing) Mod 2 = 1, "White", "Silver")

0
 
mlmccCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now