The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+
Row

WorksheetPrintOptions.BlackAndWhite Property

Gets or sets whether to print the worksheet in black and white or in color.

Namespace: DevExpress.Spreadsheet

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

Declaration

bool BlackAndWhite { get; set; }
Property BlackAndWhite As Boolean
bool BlackAndWhite { get; set; }
Property BlackAndWhite As Boolean
bool BlackAndWhite { get; set; }
Property BlackAndWhite As Boolean

Property Value

Type Description
Boolean

true, to print the worksheet in black and white; otherwise, false.

Property Value

Type Description
Boolean

true, to print the worksheet in black and white; otherwise, false.

Property Value

Type Description
Boolean

true, to print the worksheet in black and white; otherwise, false.

Remarks

Use this property to print your worksheet in black and white.

Spreadsheet_Print_Grayscale

Examples

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;
See Also