错误:“缺少必需的子元素”

时间:2015-03-19 03:06:43

标签: c# xml serialization reporting-services xml-serialization

按照Lesson 5: Publish the Report Definition to the Report Server for SQL Server 2012中的步骤操作,我出现以下错误:

  

此报告的定义无效或不受此支持   Reporting Services的版本。报告定义可能是   使用更高版本的Reporting Services创建,或包含内容   基于Reporting Services的格式不正确或无效   模式。详细信息:报表定义元素“报表”为空   第1878行,第3行。它缺少类型的强制子元素   'ReportSections'。

当我到达最后一行时:

_reportService.SetItemDefinition(reportPath, bytes, null);

此问题与我之前在Error < Report xmlns='NonEmpty' > was not expected的问题有关。

我跳过了一个步骤Lesson 4: Update the Report Definition Programmatically,只是为了确保我没有对成功反序列化的对象进行任何修改。

在第5课中,我已成功将未触摸的对象序列化回内存流,但未能将其写回报表服务器。请帮忙。

1 个答案:

答案 0 :(得分:0)

我通过替换Lesson 2: Generate Classes from the RDL Schema using the xsd Tool中的XSD解决了这个问题。

自:

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

要:

http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition/ReportDefinition.xsd
相关问题