ActiveReports 9 > ActiveReports User Guide > How To > Section Report How To > Print Multiple Copies, Duplex and Landscape |
In a section report, you can modify various printer settings or print multiple copies of a report at design time and at runtime.
At design time, you can set up duplex printing, page orientation, collation, and page size in the Printer Settings tab of the Report Settings Dialog.
To set up duplex printing in Printer Settings
To use code to set up duplex printing
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the ReportStart event. |
Copy Code
|
---|---|
Me.PageSettings.Duplex = System.Drawing.Printing.Duplex.Horizontal |
To write the code in C#
C# code. Paste INSIDE the ReportStart event. |
Copy Code
|
---|---|
this.PageSettings.Duplex = System.Drawing.Printing.Duplex.Horizontal; |
To set page orientation on the Printer Settings page
To use code to change page orientation
Note: Page orientation can only be modified before the report runs. Otherwise, changes made to the page orientation are not used during printing. |
The following example shows what the code for the method looks like.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the ReportStart event. |
Copy Code
|
---|---|
Me.PageSettings.Orientation = GrapeCity.ActiveReports.Document.Section.PageOrientation.Landscape |
To write the code in C#
C# code. Paste INSIDE the ReportStart event. |
Copy Code
|
---|---|
this.PageSettings.Orientation = GrapeCity.ActiveReports.Document.Section.PageOrientation.Landscape; |
You can print multiple copies using the Print dialog in the Preview tab or in the Viewer, or you can use code to set the number of copies to print.
To set multiple copies in the print dialog
To use code to set multiple copies
The following example shows what the code for the method looks like for printing five copies.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the ReportStart event. |
Copy Code
|
---|---|
Me.Document.Printer.PrinterSettings.Copies = 5 |
Visual Basic.NET code. Paste INSIDE the ReportEnd event. |
Copy Code
|
---|---|
Me.Document.Printer.Print() |
To write the code in C#
C# code. Paste INSIDE the ReportStart event. |
Copy Code
|
---|---|
this.Document.Printer.PrinterSettings.Copies = 5; |
C# code. Paste INSIDE the ReportEnd event. |
Copy Code
|
---|---|
this.Document.Printer.Print(); |