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

Worksheet.GetPrintableRange() Method

Returns a worksheet range that can be printed.

Namespace: DevExpress.Spreadsheet

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

Declaration

Range GetPrintableRange()

Returns

Type Description
Range

A Range object that is the printable worksheet range.

Remarks

The GetPrintableRange method returns a continuous worksheet range that meets the following requirements.

  1. The top-left cell of the printable range is the A1 cell. If this cell is hidden, the printable range starts from the top-left cell of the visible area.

    Spreadsheet_GetPrintableRange_A1E6

  2. The printable range includes all cells that have data: values (Range.Value) or formulas (Range.Formula).
  3. The printable range includes all cells containing visual formatting (fill or border).

    Spreadsheet_GetPrintableRange_A1E8_FormattedCells

  4. If a non-empty cell is located in the hidden row or column, it is not included in the printable range.
  5. The rightmost empty columns containing visual formatting (fill or border) are not included in the printable range.

    Spreadsheet_GetPrintableRange_A1E6_FilledColumn

  6. The bottommost empty rows containing visual formatting (fill or border) are not included in the printable range.

    Spreadsheet_GetPrintableRange_A1E6_FilledRow

  7. Includes all shapes (pictures and charts).

    Spreadsheet_GetPrintableRange_A1L10_Charts

  8. Includes all tables (a table occupies a range determined by the Table.Range property). If a table contains hidden rows or columns below or to the right of visible cells, they are excluded from the printable range.

    Spreadsheet_GetPrintableRange_A1F11_Tables

  9. Merged cells (empty and non-empty) are included in the printable range. If merged cells are hidden, they are not included in the printable range. If merged cells contain no data and occupy the entire row or column, they are not included in the printable range as well.

    Spreadsheet_GetPrintableRange_A1E8_MergedCells

  10. Conditional formatting is ignored.
  11. The print area (a cell range assigned to the Worksheet.SetPrintRange method and defined by the _xlnm.Print_Area name) is ignored. Use the GetPrintableRange method overload with a boolean parameter to get the printable range corresponding to the specified print area.
See Also