I have created a custom control (a windows form with a report viewer). I have the following code to load a local report:
Contained in CustomReportViewer Class
//Load local report
this.reportViewer1.ProcessingMode = ProcessingMode.Local;
//enable loading of external images
this.reportViewer1.LocalReport.EnableExternalImages = true;
//pass the report to the viewer
using (FileStream stream = new FileStream(filename, FileMode.Open))
{
this.reportViewer1.LocalReport.LoadReportDefinition(stream);
}
I call this using:
CustomReportViewer reportViewer = new CustomReportViewer();
This works fine and a windows form appears containing the report viewer control but I get the following message:
A data source instance has not been supplied for the data source "ReportData"
I'm not entirely sure how to set up the data source? The data I require is stored in a remote database...what do I have to do to set this connection up?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…