20

I am using the Visual Studio SSDT BI add-on to create reports for SQL Server Reporting Services. The project I've created is configured to target SQL Server versions 2008/2012/2014, since those are the target SQL Servers our customers have.

However, the report files being created within Visual Studio all appear to be targeting SQL Server 2016. If I copy the rdl files to another server and upload them via the browser, I am told that they are from a newer version of SSRS and can't be uploaded.

The problem is the twofold:

  1. The <Report> tag contains a new 2016 namespace that replaces the 2010 one that existed in previous versions:

    <Report 
      xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"
      xmlns:cl="http://schemas.microsoft.com/sqlserver/reporting/2010/01/componentdefinition" 
      xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition">
    
  2. The new file format includes a parameters layout section that is defined in the 2016 namespace, but not in the 2010 one:

     <ReportParametersLayout>
                .
                .
                .
     </ReportParametersLayout>
    

If I change the namespace back to 2010 and remove the ReportParametersLayout section, the report works just fine in SQL 2012, but Visual Studio will put it back the next time I open the report.

(Interestingly, if I deploy the reports directly from VS, I get a warning that the parameter layout is unsupported in 2012 and being removed, which implies that Visual Studio is fixing up the report definitions on the fly.)

Is there any way to force VS to leave the report files in the previous versions format?

Michael Edenfield
  • 28,070
  • 4
  • 86
  • 117
  • 1
    Has anyone found a workaround for this? The comment from Rami. A does not address the actual problem. – John Holliday Jun 29 '16 at 18:12
  • In SSDT 16.3 (Build number: 14.0.60812.0) they said: "Fixed an issue that generated invalid reports for SQL Server 2008 R2, 2012 and 2014." Does anyone know if this fixed the issue? – Ulli Nov 08 '16 at 09:35

2 Answers2

15

This is by design.

See https://connect.microsoft.com/SQLServer/Feedback/Details/2103422

Posted by Riccardo [MSFT] on 12/18/2015 at 5:07 PM
By design, TargetServerVersion affects build output files, not source files. You deploy the build output files (which you can grab from the \bin\Debug or \bin\Release folder within your project) rather than the source files.

Rami A.
  • 10,302
  • 4
  • 44
  • 87
  • because it solved my problem. I specify the target version, build, and get the reports from the bin that work with that version. – Michael Edenfield Jun 29 '16 at 18:14
  • To further clarify the answer, the .RDL source that is deployed to the target server may differ from the .RDL source you see while developing the report. Depending on the TargetServerVersion setting, Visual Studio will rewrite the .RDL files in the \bin\XXX folder and will also generate build warnings when unsupported reporting features (such as maps in SSRS 2008) are detected. – John Holliday Jun 29 '16 at 18:37
  • Thank you. I was going nuts that it changes and doesn't let me go back. – Luiz Angelo Oct 08 '16 at 01:05
  • 1
    I can't see the "Target Server Version" setting in my project properties (it is not a report project type, I have a few of these in a .DLL project that worked just fine until microsoft went end did this update) - how do I adjust that? – Ben Oct 11 '17 at 18:20
  • @Ben, if your project isn't a "Report Server Project" project type, then you won't see the "TargetServerVersion" property. A regular "Class Library" project doesn't know how to export rdl files to a different version. – Rami A. Oct 11 '17 at 22:09
  • @RamiA. I cant see "TargetServerVersion" property, how can set this? I have same issue – TyForHelpDude Oct 25 '17 at 10:09
  • @TyForHelpDude, are you looking at the project properties for a "Report Server Project" type or something else? If you don't see that property, what else do you see? Which version of Visual Studio? – Rami A. Oct 25 '17 at 22:02
3

Had the same issue using SSDT version 14.0.60305.0.

1) I was able to change the xmls namespace attribute in the <report> tag of each of my reports to match the target environment. Reference https://msdn.microsoft.com/en-us/library/cc627465.aspx on how to determine the RDL Schema version of the target server.

2) I changed the TargetServerVersion in the project properties pages to "SQL Server 2008 R2, 2012, or 2014". Reference http://www.sqlskills.com/blogs/tim/issue-publishing-to-ssrs-2012-with-ssdt-2015/ to see how to open the project properties page.

HTH

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
aEon'
  • 71
  • 7
  • In SO there is a rule that says "Answers should always provide an answer" . Your post should be a comment. – alejandro zuleta Mar 17 '16 at 22:40
  • Thanks, alejandro. Just noticed it and updated my answer. – aEon' Mar 17 '16 at 22:51
  • Thanks for the response, but I've already done both of these things; as I pointed out in my question, I can *publish* to a SQL 2012 server fine, but every time I edit the rdl files to *upload* them to a server, VS puts them back to the broken versions. – Michael Edenfield Mar 17 '16 at 23:21
  • Also happens with SSDT 14.0.60311.1. – Rami A. Apr 20 '16 at 20:48