Ensure SSRS feature compatibility across multiple SQL Server versions
Development teams are often faced with the challenge of developing Reporting Services solutions for multiple versions of SQL Server. Different features are introduced with new versions of SQL Server and at times it becomes hard to keep track of which feature is supported by which version. To add to the complexity, some features are also removed from SQL Server versions. Let's say I have the latest version of SQL Server installed and I have to develop reports for SQL Server 2008/2008 R2/2012/2014, it can become challenging to develop a solution that works for each of these versions. Read this tip to learn of an easy way to identify issues between versions.
SQL Server Data Tools (SSDT) 2015 provides a new property named Target Server Version to check feature support / platform compatibility against the targeted server version. In this tip we will create a sample SQL Server Reporting Services (SSRS) report and use some of the latest features of SQL Server 2016 that are not supported by earlier versions of SQL Server to see how we can find these incompatibilities. Follow the steps mentioned below.
Create a Sample SSRS 2016 Report
First, we need to create a sample solution. In the tip Create a Treemap Graph in SQL Server Reporting Services 2016, there are instructions to create a TreeMap report. TreeMap is the new chart type which has been introduced with SSRS 2016. If you follow the instructions in the tip, you should be able to see a report similar to below and this report should work smoothly in the preview mode.
Testing Report for Other SSRS Versions
Now let's say, we want to determine whether this report would work with the SQL Server 2008. In order to verify the Solution's components (graphs or other) compatibility, it is better to verify before deployment. To do so, a new solution property named "TargetServerVersion" could be utilized to verify the SQL Server version dependency. Right click on the project, which in our scenario is "Sample Report Prj" and select "Properties" as shown below.
You will be able to see the TargetServerVersion property which has three values. It also has an option to detect the version on which the solution is being deployed. Let's change this to SQL Server 2008 and save the solution.
If you try to preview the report now, you may get an error message as shown below.
If we look at the output errors in the screen below, it clearly states the Treemap is not compatible with earlier versions of SQL Server.
ConclusionIn this way we can use the TargetServerVersion property to ensure the solution's platform compatibility with different versions of SQL Server.
- Build the solution using tip Create a Treemap Graph in SQL Server Reporting Services 2016 and try and configure the TargetServerVersion property.
- For more about SQL Server 2016, read these other SQL Server 2016 tips.
About the author
View all my tips
Article Last Updated: 2016-07-18