I am trying to do something like:
this.reportViewer.LocalReport.DataSources.Clear();
DataTable dt = new DataTable();
dt = this.inputValuesTableAdapter.GetData();
Microsoft.Reporting.WinForms.ReportDataSource rprtDTSource = new Microsoft.Reporting.WinForms.ReportDataSource();
rprtDTSource = dt; // this line generates exception
//this.reportViewer.LocalReport.DataSources.Add(rprtDTSource);
this.reportViewer.RefreshReport();
How can I load datatable as ReportDataSource?
The current code produces:
"Cannot implicitly convert type 'System.Data.DataTable' to 'Microsoft.Reporting.WinForms.ReportDataSource' "
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…