I've created an rdlc report. I have a reportViewer on my form.
When I try to load the report I get : "The report definition for report 'xxxx.rdlc' has not been specified". I can't figure this out.
I have a datatable with the data I need for the report.
I take this dataTable and I load it back to my database, to a table called "FinalReport". (The reason i'm doing this, is because that rdlc requires some sort of a dataSource.)
I have a table inside my report (table1).
This is my code (inside my form, where the report viewer is located):
this.finalDataReportTableAdapter.Fill(this.nehasitDataSet.FinalDataReport);
localReport.ReportEmbeddedResource = @"ResourcesVisibleAssets.rdlc";
//I'm not so sure about the following line, but it's the only line that prevented me from getting an error ("no reportdefinition defined"
using (StreamReader rdlcSR = new StreamReader(@"ResourcesVisibleAssets.rdlc"))
{
localReport.LoadReportDefinition(rdlcSR);
localReport.Refresh();
}
this.reportViewer.RefreshReport();
I also connected the report to the dataTable and the reportViewer to the report.
I really can't see the problem, and I searched Google for it.
Any help will be highly appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…