winform 中如何将查询出的数据(DataSet或DataTable)显示在reportViewer?
winform 中如何将查询出的数据(DataSet或DataTable)显示在reportViewer?
2、代码如何写?
BindingSource BindingSource1 = new BindingSource();
BindingSource1.DataSource = DataSet1;//DataSet1在前面已加载,无误
ReportDataSource ReportDataSource1 = new ReportDataSource();
ReportDataSource1.Value = BindingSource1;
this.reportViewer1.LocalReport.DataSources.Add(ReportDataSource1);
this.reportViewer1.RefreshReport();