XlPageMargins.PageUnits Property
Gets or sets the unit of margin measurement.
Namespace: DevExpress.Export.Xl
Assembly: DevExpress.Printing.v24.2.Core.dll
NuGet Package: DevExpress.Printing.Core
#Declaration
public XlPageUnits PageUnits { get; set; }
#Property Value
Type | Description |
---|---|
Xl |
An Xl The default is Xl |
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
Note
A complete sample project is available at https://github.
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;
#Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the PageUnits property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.