2

In SSRS 2016 I have a matrix that is using a recursive parent hierarchy and have the following expression outside of the column groups, this textbox is the referenced for the Color property to set the text White or Black:

=IIF(Level() = 0 And Fields!HasChildren.Value, "White", "Black")

This works perfectly fine using the preview in SQL Server Data Tools but when viewing the deployed report in report manager when this expression is true the row group text box has black text and not white, yet the column group text boxes have white text as expected.

If I export the report into Excel, Word, PDF, MHTML when the expression is true all text is white. This appears to a problem with the ReportViewer and it is the same in IE11 and Chrome 68.0.3440.84

Putting the expression directly on the textbox does not fix the issue, I have found that if I put the actual expression within the same textbox as a placeholder the property is set correctly.

Any suggestions on how to resolve this?

Expected: enter image description here

Actual: enter image description here

mheptinstall
  • 2,109
  • 3
  • 24
  • 44

3 Answers3

1

I believe this patch from Microsoft fixes the problem properly:

[https://support.microsoft.com/en-au/help/4338240/kb4338240-fix-toggle-item-font-color-and-background-color-expressions][1]

If your organisation won't let you deploy this patch, a workaround is to make the cell contents into an HTML placeholder, then use <font> and <b> etc. tags (possibly generated conditionally) to control the formatting of the cell. If the cell has numerical information in it, change the text box format to General and use the format() function in the cell's value expression to convert the value to text (the format string can be whatever it was in the Properties window for the cell)

0

I had this problem too. Not sure if I can nail it down specifically, but what I did was looked at the canGrow and canShrink properties of every cell on the row, and make sure they are all the set the same way. In my case, both were set to true. Once I did that, the coloring rendered correctly on screen in SSRS.

Looked here because I had a very different problem that I was banging my head against the wall for where the problem wound up being settings for this field being different for cells in the same row.

liver.larson
  • 164
  • 8
0

I found the expression based foreground colour property doesn't propagate past the first column to any cell that has canGrow false. canShrink has no effect. Other cell properties don't show this problem.

Thanks liver.larson.