错误< Report xmlns ='NonEmpty'>没想到 [英] Error <Report xmlns='NonEmpty'> was not expected

查看:80
本文介绍了错误< Report xmlns ='NonEmpty'>没想到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按照课程 3:从SQL Server 2012的报表服务器加载报表定义,出现以下错误:

Following the steps from Lesson 3: Load a Report Definition from the Report Server for SQL Server 2012, I have the following error:

System.InvalidOperationException was unhandled   
HResult=-2146233079  
Message=There is an error in XML document (2, 2)
.
.
InnerException: System.InvalidOperationException
       HResult=-2146233079
       Message=<Report xmlns='http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition'> was not expected.

当我到达最后一行时:

_report = (Report)serializer.Deserialize(stream);

可以肯定的是,我已经将内存流转储到一个文件中,并将其与我上传到报表服务器中的RDL进行了比较.

To be sure, I had dumped the memory stream into a file, and compare that with the RDL I uploaded into the Report Server, to be exactly the same.

推荐答案

正确的解决方案是替换

The correct solution is to replace the XSD in the Lesson 2: Generate Classes from the RDL Schema using the xsd Tool.

发件人:

http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition/ReportDefinition.xsd

收件人:

http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition/ReportDefinition.xsd

不要通过操纵XmlRootAttribute.Namespace来破解"它,这只能掩盖问题.当我们要面对这里.

Not to "hack" it by manipulating its XmlRootAttribute.Namespace, which only good to mask the problem. New problem will emerge when we want to write the serialized object back to the Report Server as I faced here.

这篇关于错误&lt; Report xmlns ='NonEmpty'&gt;没想到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆