首页 > 其他 > 详细

MS Report踩坑与 /reporting/2016/01/reportdefinition cannot be upgraded 解决方案

时间:2021-07-29 01:05:17      阅读:17      评论:0      收藏:0      [点我收藏+]

最近在做MS Report相关的内容,遇到了个坑,记录一下。

环境: VS2019 + RDLC Designer 15.3.1 + Microsoft.ReportViewer.Common 10 + Microsoft.ReportViewer.Winfom 10

 

问题: 运行报表时会出现 The report definition has an invalid target namespace ‘http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition‘ which cannot be upgraded. 

 

解决方案一; 根据Stackoverflow提供的方法(reporting services - SSRS report definition is newer than Server - Stack Overflow)。

用xml编辑器或文本模式打开RDLC文件,然后

1、把http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition改为http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition

2、删除  <ReportSections>和<ReportSection>(只删除这两个,里面的内容不删)

3、删除整个<ReportParametersLayout>

 

缺点: 差不多每次更改报表可能都要手动执行以上步骤。

 

解决方案二:使用Microsoft.ReportingServices.ReportViewerControl.Winforms 140 或 150 代替Microsoft.ReportViewer.Common 10 + Microsoft.ReportViewer.Winfom 10

 

原因与分析:估计是RDLC Designer的问题,新建一个空白报表时 xml的namespace是 2008的,但如果增加了参数后久变成了2016。用解决方案一临时解决后,如果以后需要编辑、调整用到参数的控件,和新增、修改参数,都会导致xml的namespace从2008变成2016。而Microsoft.ReportViewer.Common 10 和 Microsoft.ReportViewer.Winfom 10 无法处理2016的格式。

MS Report踩坑与 /reporting/2016/01/reportdefinition cannot be upgraded 解决方案

原文:https://www.cnblogs.com/medicinezhong/p/15073257.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!