Conditional Formatting not working in reports exported to Excel from SQL Server 2000 Reporting Services SP2
Consider the following scenario:
You have a report deployed on a SQL Server 2000 Reporting Services SP2 instance. This report contains conditional formatting for some of the dataregions or for some cells inside a table/matrix. The format property that we want to have as a function of a certain expression is the color. So we want the coloring of the text inside a cell to depend on an expression of our choice.
If we render the report using the HTML renderer extension or the PDF, everything comes up fine and we can see different colors for our selected cell, depending on the evaluated expression we chose for the color property.
If we try exporting the report to Excel format however, the cells completely disregard the conditional formatting (conditional coloring in our case) and show the same color. This happens because the processing path for the Excel rendering extension makes so that the color property evaluated together with the background color and therefore if the background color is a constant, the color will expression will not be evaluated.
To work around this we only need to make the Backround color be an expression instead of a constant. We can do this by simply specifying << ="Color" >> on the value of the BackgroundColor property instead of <<Color>>.
Comments
Anonymous
March 20, 2012
I know this post is quite old but I cannot find anyone else who has posted anything like this. I have a scenario where I have a SQL Reporting 2005 report that gets exported to Excel and I need for the background color expression (=iif(reportitems!textbox7.Value>10,"Green","Red")) of a textbox to become the conditional format of that cell in Excel. How do I do this?Anonymous
November 12, 2013
Have you found a solution to this yet?