ActiveReports.Document Send comments on this topic.
Printer Class
See Also  Members   Example 
ActiveReports.Document Assembly > DataDynamics.ActiveReports.Document Namespace : Printer Class

Manages printer settings while running the report.

Syntax

Visual Basic (Declaration) 
Public Class Printer 
   Inherits PrintDocument
C# 
public class Printer : PrintDocument 

Example

C#Copy Code
private void arv_Load(object sender, System.EventArgs e)
{
   ActiveReport1 rpt =
new ActiveReport1();
   System.Drawing.Printing.PaperSize p =
new System.Drawing.Printing.PaperSize("Custom Paper Size", 400, 900); //hundredths of an inch
   
rpt.Document.Printer.PrinterName = ""; //use the virtual print driver for paper sizes not supported by the local printer
   
rpt.Document.Printer.PaperKind = System.Drawing.Printing.PaperKind.Custom;
   rpt.Document.Printer.PaperSize = p;
   rpt.Document.Printer.Landscape = true;
   rpt.Run();
   arv.Document = rpt.Document;
}
Visual BasicCopy Code
Private Sub arv_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles arv.Load
    Dim rpt As New ActiveReport1
    Dim p As New System.Drawing.Printing.PaperSize("Custom Paper Size", 400, 900) 'hundredths of an inch
    With rpt.Document.Printer
        .PrinterName = "" 'use the virtual print driver for paper sizes not supported by the local printer
        .PaperKind = Printing.PaperKind.Custom
        .PaperSize = p
        .Landscape = True
    End With
    rpt.Run()
    arv.Document = rpt.Document
End Sub

Remarks

When a report starts, the PageSettings properties are used to set the initial values of the Document.Printer property.  PageSettings properties that are set to Default get their values from the selected Printer. To print with a local printer, specify the printer name your Control Panel. To print from a network printer, specify the server name then the printer name that is hosted on the server.

Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         System.Drawing.Printing.PrintDocument
            DataDynamics.ActiveReports.Document.Printer

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also