我可以在 Visual Studio 中控制新 SSDT 报告的版本吗?

问题描述:

我正在使用 Visual Studio SSDT BI 插件为 SQL Server Reporting Services 创建报告.我创建的项目配置为面向 SQL Server 版本 2008/2012/2014,因为这些是我们客户拥有的目标 SQL Server.

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.

但是,在 Visual Studio 中创建的报告文件似乎都针对 SQL Server 2016.如果我将 rdl 文件复制到另一台服务器并通过浏览器上传它们,我会被告知它们来自较新版本的 SSRS,无法上传.

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.

问题是双重的:

  1. <Report> 标记包含一个新的 2016 命名空间,该标记替换了先前版本中存在的 2010 命名空间:

  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">

  • 新文件格式包括在 2016 命名空间中定义的参数布局部分,但在 2010 命名空间中未定义:

  • The new file format includes a parameters layout section that is defined in the 2016 namespace, but not in the 2010 one:

     <ReportParametersLayout>
                .
                .
                .
     </ReportParametersLayout>
    

  • 如果我将命名空间改回 2010 并删除 ReportParametersLayout 部分,则该报告在 SQL 2012 中工作正常,但 Visual Studio 下次会将其放回原处我打开报告.

    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.

    (有趣的是,如果我直接从 VS 部署报告,我会收到警告,指出 2012 年不支持参数布局并被删除,这意味着 Visual Studio 正在即时修复报告定义.)

    (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.)

    有什么办法可以强制VS保留以前版本格式的报表文件吗?

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

    这是设计使然.

    请参阅https://connect.microsoft.com/SQLServer/Feedback/Details/2103422

    由 Riccardo [MSFT] 于 2015 年 12 月 18 日下午 5:07 发布
    按照设计,TargetServerVersion 影响构建输出文件,而不是源文件.您部署构建输出文件(您可以从项目中的 \bin\Debug 或 \bin\Release 文件夹中获取)而不是源文件.