Reputation: 3333
Is it possible to use datatables as datasource for reportviewer component? Can you provide refference or simple steps how to do that?
And one important thing: i'm using reportviewer for webforms (ASP.net)
Upvotes: 0
Views: 5589
Reputation: 13303
Try something like this.
this.reportViewer.LocalReport.DataSources.Clear();
DataTable dt = new DataTable();
dt = this.inputValuesTableAdapter.GetData();
Microsoft.Reporting.WinForms.ReportDataSource rprtDTSource = new Microsoft.Reporting.WinForms.ReportDataSource(dt.TableName, dt);
this.reportViewer.LocalReport.DataSources.Add(rprtDTSource);
this.reportViewer.RefreshReport();
Hope it helps
Upvotes: 2