我想将 2 个 .rdlc 文件(使用 C#(合并到单个 .rdlc 中,以便它在报表查看器控件中的单个文件中打印。
这就是我正在尝试的:
this.reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.ReportPath = "model1.rdlc";
reportViewer1.LocalReport.ReportPath = "model2.rdlc";
this.reportViewer1.LocalReport.DataSources.Add(datasource);
this.reportViewer1.RefreshReport();
但它只向我展示了第二份报告(model2.rdlc(
报表查看器一次只显示一个报表文件
因为您覆盖了第二行的报告路径它的行为是这样的(显示上一个报告(
您有一些选择:
1-在第一个报表中使用子报表,并将supreport参数设置为报表2。
2-对一个报告使用多个数据,并在报告中合并两个报告。
3-使用页面制动器选项将报表拆分为多个页面,但它有一些限制,因为它无法在任何区域工作,除非它在报表中有一个容器,如(表格 - 矩形 - 矩阵(。