Error: “missing a mandatory child element”

半世苍凉 提交于 2019-12-25 00:55:18

问题


Following the steps from Lesson 5: Publish the Report Definition to the Report Server for SQL Server 2012, I have the following error:

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: The report definition element 'Report' is empty at line 1878, position 3. It is missing a mandatory child element of type 'ReportSections'.

When I reached the last line:

_reportService.SetItemDefinition(reportPath, bytes, null);

This question is related to my previous question at Error < Report xmlns='NonEmpty' > was not expected.

I have skipped a step, Lesson 4: Update the Report Definition Programmatically, just to be sure that I have not modified anything to the successfully deserialized object.

In this Lesson 5, I have successfully serialized back the untouched object into memory stream, but failed to to write it back into the Report Server. Please help.


回答1:


I solved it by replacing the XSD in the Lesson 2: Generate Classes from the RDL Schema using the xsd Tool.

From:

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

To:

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


来源:https://stackoverflow.com/questions/29136559/error-missing-a-mandatory-child-element

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!