How to Apply Alternating Row Colors in an SSRS Tablix

How to Apply Alternating Row Colors in an SSRS Tablix

Many organizations use SSRS to work with large amounts of data. But as reports get bigger, they can become harder to read. One simple way to improve clarity is by applying alternating row colors. This technique helps users quickly scan through rows and spot patterns more easily. This blog will give you a better understanding of how you can add alternating row colors to tables, groups, and matrices in an SSRS tablix using the Bold Reports® Designer.

Understanding alternating row colors in SSRS tablixes

Alternating row colors is a form of conditional formatting in an SSRS tablix. It improves report readability by visually distinguishing rows, especially in large datasets, making it easier for users to scan and compare data across tables.

Alternating row colors in a report
Alternating row colors in a report

Why use alternating row colors in an SSRS tablix?

Alternating row colors are usually used for the following reasons:

  • Improves data clarity: In large datasets, alternating colors cuts down on visual clutter and makes it easier to notice patterns or issues.
  • Facilitates quick data scanning: Users can scan through rows quickly without getting confused, which is useful for printed reports or when saving to Excel or PDF.
  • Improves readability: Alternating colors help users maintain alignment across rows, minimizing the risk of reading values from the wrong column or row.
  • Enhances visual structure: The use of color adds an effective layer of organization, making the report look more professional and be easier to navigate.

How to apply alternating row colors in an SSRS tablix

Applying alternating row colors in an SSRS tablix enhances report readability and visual clarity in Bold Reports. The following is the step-by-step guide on how to apply them in tables, groupings, and matrix reports using expressions for each layout.

How to apply alternating row colors in a table

Step 1: Open your table report item in the Report Designer. You can see how to create a new one in our documentation.

Step 2: On the designer page, select the entire row group by clicking on the row handle on the left side.

Row selected in the Bold Reports Report Designer page
Row selected in the Bold Reports Report Designer page

Step 3: Under the Appearance category, click the square icon at the right corner of the Background Color property and click the Expression menu to open the expressio

Appearance setting for table
Appearance setting for table

Step 4: Add the following expression in the expression builder and click OK.
=IIF(RowNumber(Nothing) MOD 2, “#F4F4F4”, “#FFFFFF”)

Set expression for applying background color to table’s row
Set expression for applying background color to table’s row

RowNumber: Gives you a running count of rows in a paginated report, based on the scope you choose.
Nothing: Means it counts the rows across the whole dataset, without any specific group or filter.

Step 5: Click Preview at the top-right corner to confirm the alternating row colors applied to the table.

Row colors in a table
Row colors in a table

How to apply alternating row colors to groupings of rows in a table

Step 1: Open the downloaded grouping report in the Bold Reports Report Designer. See how to create a table report in this documentation.

Downloaded report in Report Designer
Downloaded report in Report Designer

Step 2: Select the first-row group cell (for example Customer ID).

Step 3: In the Appearance category, click the small square icon next to Background Color, then choose Expression.

Appearance category
Appearance category

Step 4: Set the following expression in the expression builder and click OK.
=IIF(RunningValue(Fields!ProdCat.Value, CountDistinct, Nothing) MOD 2, “#F4F4F4”, “#FFFFFF”)

Set expression for apply background color in grouping’s row
Set expression for applying background color in grouping’s row

Running value: Returns a running total of all non-null numeric values from the expression, calculated within the specified scope.

CountDistinct: Returns the total of all distinct non-null values specified by the expression in a paginated report, evaluated in the context of the specific scope.

Step 5: Set the following expression in the expression builder and click OK: =IIF(RunningValue(Fields!SubCat.Value, CountDistinct, Nothing) MOD 2, “#F4F4F4”, “#FFFFFF”)

Click okay after setting the expression builder
Click okay after setting the expression builder

Step 6: Click Preview in the top-right corner to confirm that alternate row colors are applied to the groupings.

Alternating row colors applied to groups in table
Alternating row colors applied to groups in table

Next, we will explore how to add alternating row colors in a matrix report, which offers a wider view of data.

How to apply alternating row colors in a matrix

Step 1: Open the matrix report in the Report Designer. See how to create a new report in this documentation.

Downloaded reports in Bold Reports designer
Downloaded reports in Bold Reports designer

Step 2: Select the first-row group cell (e.g., ProdCat).

Step 3: Click the square icon at the right corner of the Background Color property under the Appearance category. Then select the Expression menu to open the expression builder.

Select the expression menu
Select the expression menu

Step 4: Set the following expression in the expression builder and click OK.
=IIF(RunningValue(Fields!SubCat.Value, CountDistinct, Nothing) MOD 2, “#F4F4F4”, “#FFFFFF”)

Set expression for applying background color in grouping’s row
Set expression for applying background color in grouping’s row

Step 5: Preview the matrix report to confirm that the alternating row colors are applied.

Alternating Row colors applied to group of table
Alternating Row colors applied to group of table

By following these steps, you can apply alternating colors across different report types, making your data easier to understand and more visually appealing.

Make your SSRS reports clearer with alternating row colors

Using different colors for alternate rows in an SSRS tablix is a simple way to make your reports easier to read and more professional-looking. This step-by-step guide makes it easy to add design improvements that enhance your reporting in Bold Reports.

If you need assistance or would like a quick overview of our product, please book a free 30-minute demo with our experts. You’ll be able to see how Bold Reports® can improve your data presentation and highlight patterns. Alternatively, you can sign up for a 30-day free trial to get started right away.

Eunice Damaris Akinyi Avatar

MEET THE AUTHOR

Eunice brings a unique blend of technical knowledge and expertise in creative writing. Her work focuses on drafting engaging content to help users understand Bold Reports. She plays a crucial role in educating users to make the most of Syncfusion's innovative solutions.

Connect with the author on LinkedIn.

2 Comments

  1. I am not getting the result because the in my case the inner row group has same values for each row. Can you please suggest any solution for that scenario.

  2. Hi Rohit,

    We were unable to understand the reported issue from our side with the given details. Could you please create a support ticket using your account in the link below and share the additional details of this issue, along with the issue snap and report with the expression details, and share it with us? It will be helpful for further validation.

    https://support.boldreports.com/create

Leave a Reply

Your email address will not be published. Required fields are marked *