问题
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