Back to Devexpress

ReportSettingsBase.ReportUnit Property

xtrareports-devexpress-dot-xtrareports-dot-userdesigner-dot-reportsettingsbase-8d24eb33.md

latest5.2 KB
Original Source

ReportSettingsBase.ReportUnit Property

Specifies units to measure locations, dimensions and margins in the report.

Namespace : DevExpress.XtraReports.UserDesigner

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
[DefaultValue(ReportUnit.HundredthsOfAnInch)]
public ReportUnit ReportUnit { get; set; }
vb
<DefaultValue(ReportUnit.HundredthsOfAnInch)>
Public Property ReportUnit As ReportUnit

Property Value

TypeDefaultDescription
ReportUnitHundredthsOfAnInch

A ReportUnit enumeration value.

|

Available values:

NameDescription
Inches

The unit of measurement is in inches.

| | HundredthsOfAnInch |

The unit of measurement is in hundredths of an inch.

| | Millimeters |

The unit of measurement is in millimeters.

| | TenthsOfAMillimeter |

The unit of measurement is in tenths of a millimeter.

| | Pixels |

The unit of measurement is in pixels (one pixel equals 1 / 96 of an inch).

|

Remarks

The ReportUnit property specifies the measurement units to use for the contol’s XRControl.SizeF and XRControl.LocationF property types.

Only the XRControl.BorderWidth property value is expressed in ReportUnit.Pixels.

See the Report Units of Measurement topic for a complete list of properties this option affects.

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