SunVigna
SunVigna

Reputation: 77

Background color change in SSRS

I'm trying to Highlight the row for 'Major group' and its 'subgroup' row in my report. where I have to change the background color of the row depending on the string value in the cell.

Ex: if the column has a value 'MG' in it, the cell should show a 'SomeColor, say Green' background color. I tried the following:

=IIF(Fields!ProductGroup.Value = "MG", "Green", "No Color")

tried

=Switch(Fields!ProductGroup.Value = "MG", "DarkViolet", Fields!ProductGroup.Value="SG","Gold")

Nothing is working for me. What am I missing?

Upvotes: 3

Views: 7862

Answers (3)

Shruti Kapoor
Shruti Kapoor

Reputation: 1136

Your code is fine. The problem is that "No Color" is not a defined color. Replace "No Color" with "Transparent"

Upvotes: 0

DebugThug
DebugThug

Reputation: 51

Some Browsers cannot handle "Transparency" or "No Color".

It is best to add "White" as the background color. All browsers can handle white.

Upvotes: 4

Phillip Goin
Phillip Goin

Reputation: 51

If you are using SSRS 2008 or SSRS 2008 R2 Service Release 0 or earlier, No Color and Transparent are 8 digit hex codes ("#FFFFFFFF"), But Background Colors only support 6 digit Hex codes ("#FFFFFF"). The extra two bits are Transparency level and are not supported for Background Colors. You need to use Nothing instead to prevent warnings. I believe this has been fixed in SSRS 2012.

Upvotes: 5

Related Questions