The report definition for report 'Report1' has not been specified

删除回忆录丶 提交于 2019-12-24 02:56:23

问题


I created a rdlc report in visual studio 2012 webapplication project.t Did all steps correctly (all are done from the UI's) not do any coding when I run the project I alwasy get following error

An error occurred during local report processing.
    The report definition for report 'Report1' has not been specified
        Object reference not set to an instance of an object.

then set the ReportViewer1.LocalReport.ReportPath= property from the codebehind.then error desapier and working properly.my headache was how to set this property without doing any coding ?


回答1:


replace this line in your report view

<LocalReport ReportEmbeddedResource="report.Report1.rdlc">

to this line

 <LocalReport Reportpath="Report1.rdlc">



回答2:


If by 'without doing any coding' you mean without using the code-behind file, then you can set the ReportPath property inside the ReportViewer control itself like so:

<rsweb:ReportViewer id="report" runat="server">
    <LocalReport ReportPath="Your report path here"></LocalReport>
</rsweb:ReportViewer>


来源:https://stackoverflow.com/questions/18650571/the-report-definition-for-report-report1-has-not-been-specified

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