ActiveReports.Viewer3 Request technical support
PaperSize Property
See Also  Example


Sets or returns the custom paper size object to be used to print the report.

Syntax

Visual Basic (Declaration) 
Public Property PaperSize As PaperSize
Visual Basic (Usage)Copy Code
Dim instance As Printer
Dim value As PaperSize
 
instance.PaperSize = value
 
value = instance.PaperSize
C# 
public PaperSize PaperSize {get; set;}

Return Value

A custom PaperSize object.

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

This property should be used instead of Printer.DefaultPageSettings.PaperSize because the values are cached to improve report processing.

See Also