Back to Devexpress

Worksheet.AddPrintRange(CellRange) Method

officefileapi-devexpress-dot-spreadsheet-dot-worksheet-dot-addprintrange-x28-devexpress-dot-spreadsheet-dot-cellrange-x29.md

latest2.5 KB
Original Source

Worksheet.AddPrintRange(CellRange) Method

Extends print range by merging with the specified range.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void AddPrintRange(
    CellRange range
)
vb
Sub AddPrintRange(
    range As CellRange
)

Parameters

NameTypeDescription
rangeCellRange

A CellRange object that is the worksheet range to print.

|

Remarks

If the worksheet has no print rage defined, the AddPrintRange method sets the print range. If the print range is already defined, the AddPrintRange method extends it by merging the two ranges.

Example

csharp
// 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();
vb
' Define a print area on a worksheet.
Dim printArea As CellRange = 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

SetPrintRange(CellRange)

Worksheet Interface

Worksheet Members

DevExpress.Spreadsheet Namespace