Skip to main content
Row

Worksheet.SetPrintRange(CellRange) Method

Defines the print range.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

void SetPrintRange(
    CellRange range
)

Parameters

Name Type Description
range CellRange

A CellRange object that is the worksheet range to print.

Remarks

The SetPrintRange method sets the worksheet print range. To extend the print range, use the Worksheet.AddPrintRange method.

Example

// Define a print area on a worksheet.
CellRange printArea = worksheet["B1:F39"];
worksheet.SetPrintRange(printArea);

// Enlarge the print area by adding adjacent cells.
// An additional print area is created if you add non-adjacent cells to the print area.
worksheet.AddPrintRange(worksheet["B40:F50"]);

// Uncomment the following line to clear the print area and print the entire worksheet.
// worksheet.ClearPrintRange();
See Also