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

WorksheetPrintOptions.ErrorsPrintMode Property

Gets or sets how errors contained in worksheet cells are printed.

Namespace: DevExpress.Spreadsheet

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

Declaration

ErrorsPrintMode ErrorsPrintMode { get; set; }

Property Value

Type Description
ErrorsPrintMode

An ErrorsPrintMode enumeration member.

Available values:

Name Description
Blank

Cell errors are not printed.

Dash

Cell errors are printed as double dashes.

Displayed

Cell errors are printed as they are displayed on a worksheet.

NA

Cell errors are printed as #N/A.

Property Paths

You can access this nested property as listed below:

Object Type Path to ErrorsPrintMode
Worksheet
.PrintOptions.ErrorsPrintMode

Remarks

Use the ErrorsPrintMode property to suppress printing cell errors.

Example

This example demonstrates how to set print options to create the required printout.

Use the WorksheetView properties to set general page options. The active view for a worksheet is accessible using the Worksheet.ActiveView property. Worksheet View enables you to set orientation, margins and paper size settings, among others. View settings are used when a worksheet is being printed.

Worksheet printing options is a set of more print-specific options returned by the Worksheet.PrintOptions property.

To scale the content to fit in pages, set the WorksheetPrintOptions.FitToPage property to true and specify the desired number of pages by width (WorksheetPrintOptions.FitToWidth property) or by height (the WorksheetPrintOptions.FitToHeight property). You can scale the content arbitrarily by specifying the scale percentage using the WorksheetPrintOptions.Scale property, the WorksheetPrintOptions.FitToPage property is false in this case.

Other options include printing gridlines (the WorksheetPrintOptions.PrintGridlines property), printing in color or black-and-white (the WorksheetPrintOptions.BlackAndWhite property), and more.

Note

The WorksheetPrintOptions.Draft, WorksheetPrintOptions.BlackAndWhite, WorksheetPrintOptions.NumberOfCopies and WorksheetPrintOptions.CommentsPrintMode options are not supported when printing a document from the SpreadsheetControl. 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 two pages wide.
printOptions.FitToPage = true;
printOptions.FitToWidth = 2;
//  Print a dash instead of a cell error message.
printOptions.ErrorsPrintMode = ErrorsPrintMode.Dash;
See Also