【Stimulsoft Reports.WinForms教程】使用子报表管理报表

本文主要讲解在Stimulsoft中如何使用各种选项将子报表添加到主报表。

【下载Stimulsoft Reports.Ultimate最新版本】

此示例显示如何使用各种选项将子报表添加到主报表。为此,我们需要加载所需的报表。例如,我们将收集三份报表:

private void button7_Click(object sender, System.EventArgs e){    StiReport report1 = GetReport("SimpleList.mrt");    StiReport report2 = GetReport("SimpleGroup.mrt");    StiReport report3 = GetReport("Master-Detail.mrt");...

然后创建一个主报表对象,并在SubReports集合中添加上面的报表。所述SubReports.Add()方法有两个布尔选项ResetPageNumber和PrintOnPreviousPage。您可以使用这些选项自定义子报表的显示:

...    var report = new StiReport();    report.SubReports.Add(report1);    report.SubReports.Add(report2, checkBoxResetPageNumber.Checked, checkBoxPrintOnPreviousPage.Checked);    report.SubReports.Add(report3, checkBoxResetPageNumber.Checked, checkBoxPrintOnPreviousPage.Checked);...

最后,渲染报表并在查看器中显示它:

示例代码的结果如下图所示:

Stimulsoft

下载示例

购买Stimulsoft正版授权,请点击“咨询在线客服”哟!

Stimulsoft

标签:报表报表控件StimulsoftWinForms

来源:慧都网

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2018年8月9日
下一篇 2018年8月9日

相关推荐

发表回复

登录后才能评论