-2

如何通过以下方法将两个参数传递给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();

PLZ,任何人都可以帮助我

4

1 回答 1

2

创建参数,如:

List<ReportParameter> list = new List<ReportParameter>();
ReportParameter param = new ReportParameter("name","value"));
list.Add(param);

this.reportViewer1.LocalReport.SetParameters(list);
于 2013-06-14T19:47:33.320 回答