我正在ReportDataSource使用Dapper进行查询.但是,即使有IEnumerable加载的数据,我也有一个空报告.当你花一件Datatable作品.
如何使用Dapper从查询传递数据ReportViewer?
this.reportViewer.LocalReport.DataSources.Clear();
DataTable dt = new DataTable();
dt = CN.Query(Sql, param);
Microsoft.Reporting.WinForms.ReportDataSource rprtDTSource = new Microsoft.Reporting.WinForms.ReportDataSource(dt.TableName, dt);
this.reportViewer.LocalReport.DataSources.Add(rprtDTSource);
this.reportViewer.RefreshReport(); –
Run Code Online (Sandbox Code Playgroud)