Skip to main content
.NET Framework 4.5.2+
Row

WorksheetPrintOptions Interface

Contains options used for printing a worksheet.

Namespace: DevExpress.Spreadsheet

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

Declaration

public interface WorksheetPrintOptions

Remarks

The WorksheetPrintOptions object is accessed via the Worksheet.PrintOptions property. Note that such printing options as page orientation, margins and paper size are specified via the WorksheetView.Orientation, WorksheetView.Margins and WorksheetView.PaperKind properties of the worksheet view object.

Example

This example demonstrates how to specify print options.

Note

The WorksheetPrintOptions.Draft, WorksheetPrintOptions.NumberOfCopies and WorksheetPrintOptions.CommentsPrintMode options are not supported when you print a document from the Spreadsheet. However, they are saved to a file, so you can use Microsoft® Excel® or another spreadsheet application to load and print a document.

worksheet.ActiveView.Orientation = PageOrientation.Landscape;
// Display row and column headings.
worksheet.ActiveView.ShowHeadings = true;
worksheet.ActiveView.PaperKind = System.Drawing.Printing.PaperKind.A4;
// Access an object that contains print options.
WorksheetPrintOptions printOptions = worksheet.PrintOptions;
// Do not print gridlines.
printOptions.PrintGridlines = false;
// Scale the print area to fit to the width of two pages.
printOptions.FitToPage = true;
printOptions.FitToWidth = 2;
// Print in black and white.
printOptions.BlackAndWhite = true;
// Print a dash instead of a cell error message.
printOptions.ErrorsPrintMode = ErrorsPrintMode.Dash;

The following code snippets (auto-collected from DevExpress Examples) contain references to the WorksheetPrintOptions interface.

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