如何使用rs.exe将TargetServerVersion设置为2016来部署SSRS报告?

问题描述

我们当前已安装sql Server和Reporting Services 2016。我们使用带有RSS脚本的rs.exe通过以下命令将报告部署到服务器:

rs -i ./deploy.RSS -s {Report Server URL} -e Mgmt2010"

如果在将报告项目属性“ TargetServerVersion”设置为“ sql Server 2008 R2、2012或2014”的情况下构建报告rdl文件,则此方法效果很好。但是,如果将其设置为“ sql Server 2016或更高版本”并进行重建,则在运行rs.exe时会出现以下异常:

System.Web.Services.Protocols.soapException: The deFinition of this report is not valid or supported by this version of Reporting Services. The report deFinition may have been created with a later version of Reporting Services,or contain content that is not well-formed or not valid based on Reporting Services schemas. Details: '.',hexadecimal value 0x00,is an invalid character. Line 1342,position 10.
   at Microsoft.ReportingServices.Library.ReportingService2010Impl.CreateReport(String Report,String Parent,Boolean Overwrite,Byte[] DeFinition,Property[] Properties,ItemType ItemType,CatalogItem& ItemInfo,Warning[]& Warnings)
   at Microsoft.ReportingServices.Library.ReportingService2010Impl.CreateCatalogItem(String ItemType,String Name,Warning[]& Warnings)
   at Microsoft.ReportingServices.WebServer.ReportingService2010.CreateCatalogItem(String ItemType,Warning[]& Warnings)

在deploy.RSS脚本的此部分中的CreateCatalogItem上发生异常:

Dim warnings As Warning() = nothing
Dim stream As FileStream = File.OpenRead({Path to rdl})
deFinition = New [Byte](stream.Length) {}
stream.Read(deFinition,CInt(stream.Length))
stream.Close()
rs.CreateCatalogItem("Report",{Report Name},{Report Folder},False,deFinition,nothing,warnings)

我唯一更改的是项目属性中的TargetServerVersion。还要注意,我可以使用Visual Studio菜单中的deploy将2016 rdls部署到2016报表服务器,并且一切正常。该问题仅在使用rs脚本时发生。我如何才能让rs部署2016年报告?当我拥有sql Server 2016时,我不必使用旧版本的rdls。还是不再支持rs.exe,我应该使用其他版本吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)