How to print one page of the report in several copies

2022-02-24

How to print one page of the report in several copies

If you need to print particular pages of the report in several copies, we have to use an encoding. You can configure printing properties from the user application code, as well as manually in the print dialog box. This enables you to choose particular pages of the report and set a number of copies. However, the thing is that you can set the number of copies only of all pages to be printed. That’s why we’ll have to split the printing procedure into steps to reach a goal.

Let’s say that you need to print three copies of the second page and one copy of the rest of the pages. So we’ll split the procedure into two steps: printing the second page and the rest of the pages.

//We create a report
 var report = new Report();
//We create a data source 
DataSet 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();

Thus, we can print the necessary pages apart from the rest. The only disadvantage of the above-mentioned code is that the printed pages will be out of order. If you still need to print the pages in order, you’ll have to split the procedure into three steps: printing the first page, the second page and the rest of the pages of the report.  

.NET FastReport Report Printing .NET FastReport Report Printing
April 22, 2025

Working with the TfrShellTreeView Component in FastReport VCL

In this article, we will look at the TfrShellTreeView component. It is designed to display file system elements and is partially analogous to the TDirectoryListBox, TDirectoryOutline, and TShellTreeView components.
April 22, 2025

Working with XML and JSON Formats in FastScript

In this article, we will take a closer look at how to work with JSON and XML in FastReport, see what properties and methods they have, and build reports from code with scripts.
April 21, 2025

How RFID Tags Work in FastReport VCL

In this article, we'll check out how RFID tags work with the new TfrxDeviceCommand object in FastReport VCL with release 2025.2.
Fast Reports
  • 800-985-8986 (English, US)
  • +31 97 01025-8466 (English, EU)
  • +49 30 56837-3928 (German, DE)
  • +55 19 98147-8148 (Portuguese, BR)
  • info@fast-report.com
  • 66 Canal Center Plaza, Ste 505, Alexandria, VA 22314

© 1998-2025 Fast Reports Inc.