Skip to main content
A newer version of this page is available. .

XlPrintOptions Class

Represents the object that specifies printing options for a worksheet.

Namespace: DevExpress.Export.Xl

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

Declaration

public class XlPrintOptions

The following members accept/return XlPrintOptions objects:

Remarks

To specify print options for a worksheet, set the IXlSheet.PrintOptions property to an instance of the XlPrintOptions class. Utilize the XlPrintOptions object’s XlPrintOptions.GridLines and XlPrintOptions.Headings properties to include gridlines and column and row headings in the printout. To center worksheet data on a page, use the XlPrintOptions.HorizontalCentered and XlPrintOptions.VerticalCentered properties.

For more information on how to adjust print options, refer to the How to: Specify Print Settings example.

Example

The example below demonstrates how to specify print settings for a worksheet.

Note

A complete sample project is available at https://github.com/DevExpress-Examples/xl-export-api-examples-t253492

// Specify print options for the worksheet.
sheet.PrintOptions = new XlPrintOptions();
// Print row and column headings.
sheet.PrintOptions.Headings = true;
// Print gridlines.
sheet.PrintOptions.GridLines = true;
// Center worksheet data on a printed page.
sheet.PrintOptions.HorizontalCentered = true;
sheet.PrintOptions.VerticalCentered = true;

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the XlPrintOptions class.

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.

Inheritance

Object
XlPrintOptions
See Also