Back to Devexpress

ReportSettingsBase.PageHeight Property

xtrareports-devexpress-dot-xtrareports-dot-userdesigner-dot-reportsettingsbase-9f7abfa8.md

latest4.3 KB
Original Source

ReportSettingsBase.PageHeight Property

Gets or sets report page height, measured in report units. You can set this property only if the PaperKind is set to Custom.

Namespace : DevExpress.XtraReports.UserDesigner

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
public float PageHeight { get; set; }
vb
Public Property PageHeight As Single

Property Value

Type
Single

Remarks

If your report uses a standard paper size (the PaperKind is set to any value but Custom ), the PageHeight and PageWidth properties are set to the selected paper kind’s height and width. In this case, if you change the Landscape property value, page width and page height swap their values.

The following code sample creates an End-User Designer instance and specifies default settings for its reports:

csharp
using DevExpress.XtraReports.UI;
using DevExpress.Drawing.Printing;
using DevExpress.XtraReports.UserDesigner;
// ...
XRDesignForm form = new XRDesignForm();
XRDesignMdiController reportDesigner = form.DesignMdiController;
// Report Page Settings
reportDesigner.DefaultReportSettings.PaperKind = DXPaperKind.Letter;
reportDesigner.DefaultReportSettings.Landscape = true;
reportDesigner.DefaultReportSettings.RollPaper = false;
reportDesigner.DefaultReportSettings.ReportUnit = ReportUnit.HundredthsOfAnInch;
reportDesigner.DefaultReportSettings.Margins = new System.Drawing.Printing.Margins(50, 50, 100, 100);
// Report Font Settings
reportDesigner1.DefaultReportSettings.Font = new DevExpress.Drawing.DXFont("Arial", 12f);
// Report Export Settings
reportDesigner.DefaultReportSettings.ExportSettings.FileName = "TestReport";
reportDesigner.DefaultReportSettings.ExportSettings.ExportFormat = DevExpress.XtraPrinting.ExportFormat.Xlsx;
// Report Layout Settings
reportDesigner.DefaultReportSettings.DesignerSettings.DrawGrid = false;
reportDesigner.DefaultReportSettings.DesignerSettings.SnappingMode = DevExpress.XtraReports.UI.SnappingMode.SnapToGridAndSnapLines;
form.ShowDialog();
vb
Imports DevExpress.XtraReports.UI
Imports DevExpress.Drawing.Printing
Imports DevExpress.XtraReports.UserDesigner
' ...
Private form As New XRDesignForm()
Private reportDesigner As XRDesignMdiController = form.DesignMdiController
' Report Page Settings
reportDesigner.DefaultReportSettings.PaperKind = DXPaperKind.Letter
reportDesigner.DefaultReportSettings.Landscape = True
reportDesigner.DefaultReportSettings.RollPaper = False
reportDesigner.DefaultReportSettings.ReportUnit = ReportUnit.HundredthsOfAnInch
reportDesigner.DefaultReportSettings.Margins = New System.Drawing.Printing.Margins(50, 50, 100, 100)
' Report Font Settings
reportDesigner1.DefaultReportSettings.Font = New DevExpress.Drawing.DXFont("Arial", 12F)
' Report Export Settings
reportDesigner.DefaultReportSettings.ExportSettings.FileName = "TestReport"
reportDesigner.DefaultReportSettings.ExportSettings.ExportFormat = DevExpress.XtraPrinting.ExportFormat.Xlsx
' Report Layout Settings
reportDesigner.DefaultReportSettings.DesignerSettings.DrawGrid = False
reportDesigner.DefaultReportSettings.DesignerSettings.SnappingMode = DevExpress.XtraReports.UI.SnappingMode.SnapToGridAndSnapLines
form.ShowDialog()

See Also

ReportSettingsBase Class

ReportSettingsBase Members

DevExpress.XtraReports.UserDesigner Namespace