XlPageMargins.PageUnits Property

Gets or sets the unit of margin measurement.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v21.1.Core.dll

Declaration

public XlPageUnits PageUnits { get; set; }

Property Value

Type Description
XlPageUnits

An XlPageUnits enumeration value that specifies the unit of measurement for worksheet margins.

The default is XlPageUnits.Inches.

Available values:

Name Description
Inches

Specifies inches as a unit of margin measurement.

Centimeters

Specifies centimeters as a unit of margin measurement.

Remarks

Use the PageUnits property to set the unit of margin measurement to the desired value: inches or centimeters.

Example

sheet.PageMargins = new XlPageMargins();
// Set the unit of margin measurement.
sheet.PageMargins.PageUnits = XlPageUnits.Centimeters;
// Specify page margins.
sheet.PageMargins.Left = 2.0;
sheet.PageMargins.Right = 1.0;
sheet.PageMargins.Top = 1.25;
sheet.PageMargins.Bottom = 1.25;
// Specify header and footer margins.
sheet.PageMargins.Header = 0.7;
sheet.PageMargins.Footer = 0.7;
See Also