如何在c#中使用winform传递两个参数给reportviewer
本文关键字:两个 reportviewer 参数 winform | 更新日期: 2023-09-27 18:18:40
如何通过以下方法传递两个参数给reportviewer
ADMSDataSetTableAdapters.pwl_detailsTableAdapter adapter = new ADMSDataSetTableAdapters.pwl_detailsTableAdapter();
ADMSDataSet.pwl_detailsDataTable table = new ADMSDataSet.pwl_detailsDataTable();
adapter.FillByCity(table,textbox1.text);
ReportDataSource MyNewDataSouce = new ReportDataSource("Warehouse_DataSet", (DataTable)table);
this.reportViewer1.LocalReport.DataSources.Clear();
this.reportViewer1.LocalReport.DataSources.Add(MyNewDataSouce);
this.reportViewer1.LocalReport.Refresh();
this.reportViewer1.RefreshReport();
拜托,谁能帮帮我
创建如下参数:
List<ReportParameter> list = new List<ReportParameter>();
ReportParameter param = new ReportParameter("name","value"));
list.Add(param);
this.reportViewer1.LocalReport.SetParameters(list);