See Also

Printer Class  | Printer Members

Language

Visual Basic

C#

Show All

See Also Languages ActiveReports.Viewer Send feedback to Data Dynamics

PrinterName Property

Gets or sets the name of the printer to use.

[Visual Basic]
Public Property PrinterName As String
[C#]
public string PrinterName {get; set;}

Return Type

The name of the printer to use.

Remarks

Set this property to an empty string to use the virtual printer device.  The virtual printer device allows you to avoid "Printer not Installed" errors when a machine does not have any installed printers or the user does not have access to the ones installed.

The Printer's PrinterName property must always be used instead of the Printer.PrinterSettings.PrinterName property.

Example

[C#] 

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 Basic] 

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

See Also

Printer Class  | Printer Members

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.