使用RDLC的疑问(DataTable中有多条数据为什么只显示一页)
A1027 2010-04-06 01:39:30 我是用dataset中的datatable绑定给一个reportviewer报表,datatable中有多行数据,可以reportviewer报表只显示一页(只包含第一行数据),我要求有多少行数据就分多少也,谢谢。
另外: rdlc文件,我是直接拖字段到【主体】部分,并没有使用【表】,【矩阵】等工具,因为要显示的报表不是表格形式
绑定代码:
DataSet dsTemp = DBOperator.GetDataSet(str);
dsTemp.Tables[0].TableName = "dsOrderView_dtOrderView"; //这里的tableName要和报表数据源名称一致[报表数据源名称:报表菜单-->数据源]
this.ReportViewer2.LocalReport.ReportPath = "form\\report\\reportOrderView.rdlc";
this.ReportViewer2.LocalReport.DataSources.Clear();
this.ReportViewer2.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("dsOrderView_dtOrderView", dsTemp.Tables[0]));
this.ReportViewer2.LocalReport.Refresh();