By default, C1Report creates reports using the default paper size on the default printer.
You can specify the paper size and orientation using the PaperSize and Orientation properties. However, C1Report checks that the selected paper size is available on the current printer before rendering, and changes to the default paper size if the selected setting is not available.
If you want to specify a certain paper size and use it regardless of the printers available, set the PaperSize property to Custom, and set the CustomWidth and CustomHeight properties to the page dimensions (in twips).
Notice that the measurement is converted into twips automatically. The Property window display the measurement in twips (36000).
The Property window displays the measurement in twips (15840).
Regardless of what is available on the printer, the following code sets the report paper to 25" x 11":
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
c1r.Layout.PaperSize = PaperKind.Custom c1r.Layout.CustomHeight = 25 * 1440 ' in twips c1r.Layout.CustomWidth = 11 * 1440 |
To write code in C#
C# |
Copy Code
|
---|---|
c1r.Layout.PaperSize = PaperKind.Custom; c1r.Layout.CustomHeight = 25 * 1440; // in twips c1r.Layout.CustomWidth = 11 * 1440; |