报表控件FastReport使用教程:将报告的一页打印成多份

本文主要介绍如何在FastReport.NET中将报告的一页打印成多份。

本文主要介绍如何在

如果您需要分几份打印报表的特定页面,我们必须使用编码。您可以从用户应用程序代码配置打印属性,也可以在打印对话框中手动配置。这使您可以选择报告的特定页面并设置副本数量。但是,问题是您只能设置要打印的所有页面的份数。这就是为什么我们必须将打印过程分成几个步骤才能达到目标。

假设您需要打印第二页的三份副本和其余页面的一份副本。所以我们将这个过程分为两个步骤:打印第二页和其余页面。

//We create a report var report = new Report();//We create a data sourceDataSet data = new DataSet();//We download the data from the file data.ReadXml("~/nwind.xml");//We register the data source in the report report.RegisterData(data, "NorthWind");//We download the report template report.Load("~/Master-Detail.frx"); //We prepare the report report.Prepare(); //We choose the second page of the report report.PrintSettings.PageNumbers = "2"; //We set a number of copies report.PrintSettings.Copies = 3; //We hide the print dialog box report.PrintSettings.ShowDialog = false; //We sent the report to print report.Print(); //We repeat the same steps for the rest of the pages of the report report.PrintSettings.PageNumbers = "1, 3, 4, 5"; report.PrintSettings.Copies = 1; report.Print();

因此,我们可以将必要的页面与其他页面分开打印。上述代码的唯一缺点是打印的页面会乱序。如果您仍需要按顺序打印页面,则必须将过程分为三个步骤:打印报告的第一页、第二页和其余页面。

本次FastReport.NET使用教程就介绍到这里了,更多产品授权信息点击查看FastReport.NET价格,或者咨询在线客服。

FastReport.NET技术

标签:

来源:慧都网

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

上一篇 2022年7月12日
下一篇 2022年7月12日

相关推荐

发表回复

登录后才能评论