IXlSheet.PrintOptions Property

Gets or sets specific options that control how a worksheet is printed.

Namespace: DevExpress.Export.Xl

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

Declaration

XlPrintOptions PrintOptions { get; set; }

Property Value

Type Description
XlPrintOptions

An XlPrintOptions object that contains worksheet print options.

Remarks

Use the PrintOptions property to specify print options for a worksheet. The XlPrintOptions object enables you to include gridlines and column and row headings in the printout (XlPrintOptions.GridLines and XlPrintOptions.Headings), and center worksheet data on a page (XlPrintOptions.HorizontalCentered and XlPrintOptions.VerticalCentered). To specify formatting options for a printed page (orientation, size, scale, print quality etc.), use the IXlSheet.PageSetup property.

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

Example

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

// 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 PrintOptions 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.

See Also