0

How can I format each group in SQL Server Reporting Services(SSRS) with a different background color and the items of the group with the same color Scale ? as in the following image :

any Hints or Ideas?

thanks in advance

enter image description here

QAIS
  • 139
  • 4
  • 16

1 Answers1

0

There's no built-in way to do this.

The way I usually end up doing it is with either a table with your colors joined to your data, a function for your colors, or an expression to choose the color.

If you only have 2 or 3 groups, you best bet may be to use an IIF like:

=IIF(FIELDS!GROUP.VALUE = "Group 1", "GRAY", IIF(FIELDS!GROUP.VALUE = "Group 2", "IndianRed", "LightSteelBlue"))

Here are good examples of the various methods:

https://www.mssqltips.com/sqlservertip/2797/different-ways-to-create-custom-colors-for-charts-in-sql-server-reporting-services/

If you're looking for alternating row colors for the detail, check out this:

Add alternating row color to SQL Server Reporting services report

You could incorporate both into your detail:

=Code.AlternateColor(IIF(FIELDS!GROUP.VALUE = "Group 1", "Gray"
 IIF(FIELDS!GROUP.VALUE = "Group 2", "IndianRed", "LightSteelBlue")),
 IIF(FIELDS!GROUP.VALUE = "Group 1", "LightGray", IIF(FIELDS!GROUP.VALUE = "Group 2", "MistyRose", "AliceBlue")), True)
Community
  • 1
  • 1
Hannover Fist
  • 8,301
  • 1
  • 13
  • 35