Interface IWorkbookRange

A logically rectangular shape of cells to that can be read or operated on.

interface IWorkbookRange {
    isSheetRange: true;
    isWorkbookRange: true;
    autoFit(options?): void;
    autoFitColumns(options?): void;
    autoFitRows(options?): void;
    bounds(): SheetCellRangeCoords;
    cell(options?): ICellModel;
    cells(options?): ICellModel[][];
    clear(clearType?): CellRangeCoords;
    copyTo(range, options?): void;
    forEach(visitor, options?): void;
    hideColumns(options?): void;
    hideRows(options?): void;
    insertCells(direction?, options?): void;
    isReadOnly(): boolean;
    isValid(): boolean;
    merge(mergeType?): CellRangeCoords;
    removeCells(direction?, options?): void;
    sheet(): ISheetModel;
    sort(options?): void;
    toString(): string;
    unhideColumns(options?): void;
    unhideRows(options?): void;
    unmerge(): CellRangeCoords;
    update(values, options?): void;
    updateColumns(values, options?): void;
    updateRows(values, options?): void;
    value(options?): ICellValue;
    values(options?): ICellValue[][];
    workbook(): IWorkbookModel;
}

Hierarchy (view full)

Properties

isSheetRange: true

For runtime type identification.

isWorkbookRange: true

Methods

  • Convenience that returns the first cell

    Parameters

    • Optional options: {
          includeHidden?: boolean;
      }
      • Optional includeHidden?: boolean

    Returns ICellModel

  • A 2d list of ICellModels as convenience. This calls forEach and builds a 2d array .

    Parameters

    • Optional options: {
          includeHidden?: boolean;
      }
      • Optional includeHidden?: boolean

    Returns ICellModel[][]

    Include Hidden

    Default Value

    true
    
  • Advanced and performant way to iteratively values. This allows for visiting only values that are not empty.

    Parameters

    Returns void

    Remarks

    • Visitors can return a 'break' value to stop the visit.
    • skipEmpty will ensure that only non-empty cells are visited.
    • getContext().getCell() requires additional work over getCoord or reading value.
  • If the range is valid. A range can be invalid if removed, has incorrect, or even an incorrect format.

    Returns boolean

  • Returns the address as a string

    Returns string

  • Provides a convenient method for setting values with a range of calls.

    Parameters

    Returns void

    Remarks

    If an array is passed the values will be in row-major order and will repeat if the range is larger than the array

  • Convenience that returns the first cell

    Parameters

    • Optional options: {
          datesAsJSDate?: boolean;
          includeHidden?: boolean;
      }
      • Optional datesAsJSDate?: boolean
      • Optional includeHidden?: boolean

    Returns ICellValue

  • A 2d list of values as convenience. This calls forEach and builds a 2d array.

    Parameters

    • Optional options: {
          datesAsJSDate?: boolean;
          includeHidden?: boolean;
      }
      • Optional datesAsJSDate?: boolean
      • Optional includeHidden?: boolean

    Returns ICellValue[][]

    Remarks

    This guarantees that the a 2D value with a least 1 value will always be returned. The value may be null.

    Include Hidden

    Default Value

    true
    By default values dates are returns as JSDates

    Dates As JSDate

    Default Value

    true