Back to Devexpress

XtraPageSettings Class

windowsforms-devexpress-dot-xtraprinting-f8709359.md

latest3.4 KB
Original Source

XtraPageSettings Class

Provides functionality to print reports.

Namespace : DevExpress.XtraPrinting

Assembly : DevExpress.XtraPrinting.v25.2.dll

NuGet Package : DevExpress.Win.Printing

Declaration

csharp
public class XtraPageSettings :
    XtraPageSettingsBase
vb
Public Class XtraPageSettings
    Inherits XtraPageSettingsBase

The following members return XtraPageSettings objects:

Remarks

The XtraPageSettingsBase.TopMargin, XtraPageSettingsBase.RightMargin, XtraPageSettingsBase.BottomMargin and XtraPageSettingsBase.LeftMargin properties determine the top, right, bottom and left report page margins accordingly.

The XtraPageSettingsBase.Landscape property determines report page orientation (landscape if true , portrait if false ). The XtraPageSettingsBase.PaperKind property determines the Paper Kind. All these settings are grouped in the Page Setup dialog shown below.

For more information on paper kinds refer to MSDN.

Alternatively, you can change margins by clicking them within the report page and dragging to the right, left, top or bottom.

Example

This example demonstrates how to use the XtraPageSettings class.

csharp
using System.Drawing.Printing;
using DevExpress.XtraPrinting;
// ...

// Create an XtraPageSettings instance.
XtraPageSettings pageSettings = printingSystem1.PageSettings;

// Specify the paper kind and page orientation.
pageSettings.PaperKind = PaperKind.Letter;
pageSettings.Landscape = true;

// Specify margins.
pageSettings.LeftMargin = 20;
pageSettings.RightMargin = 20;
pageSettings.TopMargin = 20;
pageSettings.BottomMargin = 20;
vb
Imports System.Drawing.Printing
Imports DevExpress.XtraPrinting
' ...

' Create an XtraPageSettings instance.
Dim pageSettings As XtraPageSettings = printingSystem1.PageSettings

' Specify the paper kind and page orientation.
pageSettings.PaperKind = PaperKind.Letter
pageSettings.Landscape = True

' Specify margins.
pageSettings.LeftMargin = 20
pageSettings.RightMargin = 20
pageSettings.TopMargin = 20
pageSettings.BottomMargin = 20

Inheritance

Object XtraPageSettingsBase XtraPageSettings

See Also

XtraPageSettings Members

DevExpress.XtraPrinting Namespace