Monday, January 07, 2013

SQL Server Reporting Services - Multiple Personality Syndrome with Dynamic Borders

Recently I was working with a SSRS 2012 report on a BI project and it required to have dynamic border styles for some of the tables in the the reports. SSRS gives you option to write "Expressions" for the border style property, for each side (Top, Bottom, Left and Right). So I simply wrote my expressions for each to dynamically change the border style to either "Solid" or "None" based on a condition. I ran the report in the debug mode, within Data Tool, and it was all fine. The border styles changed as expected.

However, The reports were supposed to be uploaded to a Report Server and executed through the web interface When I tested the same report via the web interface, non of my dynamic styles were present. It always had "Solid" style, in all the scenarios. I rechecked the source files, re-tested it within data tools and the report was running fine. But again, when I uploaded it to the report server and ran it through the web interface, the borders were always solid.

After hours of struggling with this tiny issue, I have found that border styles work in two different ways in data tools and web interface. The border style property has one extra property called "Default". The value that is specified here for default (None, Solid ...etc), will override all the expressions specified for each side (left, right ..etc) only when the report is run via the web interface.

No comments: