This walkthrough illustrates how to set multiple copies for printing a report.
This walkthrough is split up into the following activities:- Setting multiple copies for printing a report from the print dialog at run time
- Using code to set multiple copies for printing
Setting the number of copies is only supported in .NET Framework 1.0 SP3 and 1.1 SP1. |
Setting multiple copies for printing a report from the print dialog at run time
To set multiple copies for printing a report from the print dialog at run time
- Press F5 to run an existing ActiveReport.
- Click on the printer icon in the viewer window.
- In the Copies box, select the number of copies needed.
Using code to set multiple copies for printing at run time
To write the code in Visual Basic or C#
- Double-click in the gray section underneath the report to create an event-handling method for the report's ReportStart event. Add code to the handler to:
- Set multiple copies of the report for printing
The following example shows what the code for the method looks like for printing five copies.
'Visual Basic Private Sub ActiveReport1_ReportStart(ByVal sender As Object, ByVal e As System _ .EventArgs) Handles MyBase.ReportStart Me.Document.Printer.PrinterSettings.Copies = 5 End Sub
Private Sub rptPrint_ReportEnd(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles MyBase.ReportStart
Me.Document.Print(false, false)
End Sub//C# private void ActiveReport1_ReportStart(object sender, System.EventArgs eArgs) { this.Document.Printer.PrinterSettings.Copies = 5; }
private void rptPrint_ReportEnd(object sender, System.EventArgs eArgs)
{
this.Document.Print(false, false);
}