接口 IRange


public interface IRange
Represents the IRange object.
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    Activates a single cell, which must be inside the current selection.
    Adds comments to the current range.
    Adds a threaded comment to the range.
    Adds a threaded comment to the range.
    void
    Filters a list using the AutoFilter.
    Add a filter with no condition if there's no filter in the sheet.
    Or show all the data in the first column of the filter.
    void
    autoFilter(int field)
    Filters a list using the AutoFilter.
    void
    autoFilter(int field, Object criteria1)
    Filters a list using the AutoFilter.
    void
    autoFilter(int field, Object criteria1, AutoFilterOperator op)
    Filters a list using the AutoFilter.
    void
    autoFilter(int field, Object criteria1, AutoFilterOperator op, Object criteria2)
    Filters a list using the AutoFilter.
    void
    autoFilter(int field, Object criteria1, AutoFilterOperator op, Object criteria2, boolean visibleDropDown)
    Filters a list using the AutoFilter.
    void
    Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit.
    void
    autoFit(boolean considerMergedCell)
    Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit.
    void
    Calculates formulas of the range as needed.
    characters(int startIndex, int length)
    Returns a ITextRun object that represents a range of characters within the cell text.
    void
    Clears formulas, values, and all formatting from the current range.
    void
    Clears the comments from the current range
    void
    Clears the threaded comments from the current range.
    void
    Clears formulas and values from the current range.
    void
    Clears all formatting from the current range.
    void
    Clears all hyperLinks from the current range.
    void
    Clears the outline for the specified range.
    void
    copy(IRange destination)
    Copies the range to the specified range
    void
    copy(IRange destination, PasteOption pasteOption)
    Copies the range to the specified range.
    void
    cut(IRange destination)
    Cuts the range to the specified range.
    void
    Deletes a cell or a range of cells from the worksheet and shifts other cells to replace deleted cells.
    void
    delete(DeleteShiftDirection shiftDirection)
    Deletes a cell or a range of cells from the worksheet and shifts other cells to replace deleted cells.
    void
    Designates all the formulas of the range to be recalculated when the next calculation occurs.
    find(Object what)
    Finds specific information in a range, starts from the upper-left corner.
    find(Object what, FindOptions options)
    Finds specific information in a range, starts from the upper-left corner.
    find(Object what, IRange after)
    Finds specific information in a range.
    find(Object what, IRange after, FindOptions options)
    Finds specific information in a range.
    void
    Generates the range data from the json string.
    Generate the corresponding function "GETPIVOTDATA" for the cells in the pivot table.
    Generate the corresponding function "GETPIVOTDATA" for the cells in the pivot table.
    get(int index)
    Returns a new instance of IRange by index which represents a cell.
    get(int rowOffset, int columnOffset)
    Returns a new instance of IRange which is offset from this range.
    boolean
    Gets the property which controls indentation of text when horizontal or vertical alignment is set to distributed.
    Returns a String value that represents the range reference.
    getAddress(boolean rowAbsolute, boolean columnAbsolute)
    Returns a String value that represents the range reference.
    getAddress(boolean rowAbsolute, boolean columnAbsolute, ReferenceStyle referenceStyle)
    Returns a String value that represents the range reference.
    getAddress(boolean rowAbsolute, boolean columnAbsolute, ReferenceStyle referenceStyle, IRange relativeTo)
    Returns a String value that represents the range reference.
    Returns an instance of IAreas which represents an array of rangeswhere each range returned by areas represents one cell or range.
    Gets the binding path of the current cell or column.
    Returns an instance of IBorders which represents the cell borders ofthe cell or range represented by this IRange.
    Gets the cell padding for range.
    Returns the IRange object that represents the cells in the specifiedrange.
    Gets the cell type for specified range in the sheet.
    int
    Returns the zero based column number of the last column of the first range.
    int
    Returns the column count of the first range.
    Returns the IRange object that represents the columns in thespecified range.
    double
    Gets the width of the individual columns represented in this range in characters.
    double
    Gets the width of the individual columns represented in this range in pixels.
    Returns an instance of IComment which may be used to get and setComment properties of the cells.
     
    int
    Returns the number of objects in the collection.
    Gets whether the specified cell is part of an array, returns an IRange object that represents the entire array.
    Gets a DisplayFormat object that represents the display settings for the specified range.
    Returns a new instance of IRange which represents the same range ofcells, but expanded to include all rows.
    Returns an IRange representing the area of the current range which isiteratively grown as needed until it includes no partial merged cells.
    Returns a new instance of IRange which represents the same range ofcells, but expanded to include all columns.
    Returns an instance of IFont which may be used to get and set fontproperties of the cells represented by this IRange.
    Returns a FormatConditions collection that represents all the conditional formats for the specified range.
    Gets the formula of the cells represented by this range in A1-style notation.
    Gets the formula of the cells represented by this range in A1-style array notation.
    Gets the localized formula of the cells represented by this range in A1-style array notation.
    Gets the formula of the cells represented by this range in R1C1-style array notation.
    Gets the localized formula of the cells represented by this range in R1C1-style array notation.
    Gets the array formula of a range.
    Gets the array formula of a range using ReferenceStyle.R1C1.
    boolean
    Gets or Sets whether the formula will be hidden when the worksheet is protected
    Gets the localized formula of the cells represented by this range in A1-style notation.
    Gets the formula of the cells represented by this range in R1C1-style notation.
    Gets the localized formula of the cells represented by this range in R1C1-style notation.
    boolean
    Determines if the specified cell is part of an array formula.
    boolean
    Returns true if the cell or range contains any formulas; otherwise, false is returned.
    boolean
    Returns true if any of the cells represented by this range have data validation associated with them.
    double
    Gets the height, in points, of the range.
    double
    Gets the height, in pixels, of the range.
    boolean
    Gets the property which specifies whether rows or columns should be hidden.
    Gets the HorizontalAlignment of a cell or range.
    Returns an instance of IValidation which may be used to get and setHyperLinks properties.
    int
    Gets the indent level of the specified cell(s).
    Returns the IInterior which represents the interior (background)color and pattern of the specified cell(s).
    Gets the setting for watermark.
    int
    Returns the zero based column number of the first column of this IRange.
    int
    Returns the zero based row number of the last row of the first range.
    boolean
    Gets the property which specifies whether cells should be locked.
    Returns an IRange representing the merged range containing thespecified cell.
    boolean
    Gets the property which specifies whether cells are merged.
    Gets the number format of the cells in the range.
    int
    Gets the text orientation of a cell or range, which may be from -90 to 90 degrees, or 255(vertical text).
    int
    Gets the current outline level of the specified row or column.
    Gets or Sets the reading order for the specified object.
    Gets the rich text object associate with the top-left cell of this range.
    int
    Returns the zero based row number of the first row.
    int
    Returns the row count of the first range.
    double
    Gets the height of the individual rows represented by this range in points.
    double
    Gets the height of the individual rows represented by this range in pixels.
    Returns the IRange object that represents the rows in the specifiedrange.
    boolean
    Gets whether to show the detail (True if the outline is expanded for the specified range, so that the detail of the column or row is visible).
    boolean
    Gets the property which specifies whether cells will be drawn in a smaller font if needed to display the contents of the cell.
    Returns an instance of ISparklineGroups which may be used to get andset SparklineGroups properties of the cells
    Gets the named style IStyle associated with the cells represented bythis IRange.
    boolean
    Determines if the range is an outlining summary row or column.
    Gets the tag value of the specified range in the sheet.
    Gets the value of the cell represented by this IRange as a formatted string.
    Returns an IRange representing the used range in the current range.
    boolean
    Determines if the row height of the IRange object equals the standardheight of the sheet.
    boolean
    Determines if the column width of the IRange object equals thestandard width of the sheet.
    Returns an instance of IValidation which may be used to get and setvalidation properties of the cells represented by this IRange.
    boolean
    Returns true if the validation options of all cells represented by this IRange are the same; otherwise, false is returned.
    Gets the value of the specified range as a string, double, boolean, Date, Object[][] or null;
    Gets the VerticalAlignment of a cell or range.
    Gets the watermark for range.
    double
    Gets the width, in points, of the range.
    double
    Gets the width, in pixels, of the range.
    Returns the parent IWorksheet of this range.
    boolean
    Get the flag which indicates whether word wrap is enabled in a cell.
    void
    Increments the OutlineLevel of the specified rows or columns.
    void
    Inserts a cell or a range of cells into the worksheet and shifts other cells away to make space.
    void
    insert(InsertShiftDirection shiftDirection)
    Inserts a cell or a range of cells into the worksheet and shifts other cells away to make space.
    intersect(IRange range2)
    Returns an IRange object that represents the intersection of two ranges.
    intersect(IRange... ranges)
    Returns an IRange object that represents the intersection of several ranges.
    boolean
    Indicates whether the cell string value is a rich text.
    void
    Merges the cells in the represented range into a single merged cell.
    void
    merge(boolean isAcross)
    Merges the cells in the represented range into a single merged cell.
    offset(int rowOffset, int columnOffset)
    Returns an IRange object that represents the offset of this range.
    void
    Removes subtotals from a list.
    int
    replace(Object what, Object replacement)
    Search in formulas and replace.
    int
    replace(Object what, Object replacement, ReplaceOptions options)
    Search in formulas and replace.
    void
    Selects the object.
    void
    setAddIndent(boolean value)
    Sets the property which controls indentation of text when horizontal or vertical alignment is set to distributed.
    void
    Sets the binding path of the current cell or column.
    void
    Sets the cell padding for range.
    void
    Sets the cell type for specified range in the sheet.
    void
    setColumnWidth(double value)
    Sets the width of the individual columns represented in this range in characters.
    void
    setColumnWidthInPixel(double value)
    Sets the width of the individual columns represented in this range in pixels.
    void
    Sets the formula of the cells represented by this range in A1-style notation.
    void
    Sets the formula of the cells represented by this range in A1-style array notation.
    void
    Sets the localized formula of the cells represented by this range in A1-style array notation.
    void
    Sets the formula of the cells represented by this range in R1C1-style array notation.
    void
    Sets the localized formula of the cells represented by this range in R1C1-style array notation.
    void
    Sets the array formula of a range.
    void
    Sets the array formula of a range using ReferenceStyle.R1C1.
    void
    setFormulaHidden(boolean value)
    Sets whether the formula will be hidden when the worksheet is protected
    void
    Sets the localized formula of the cells represented by this range in A1-style notation.
    void
    Sets the formula of the cells represented by this range in R1C1-style notation.
    void
    Sets the localized formula of the cells represented by this range in R1C1-style notation.
    void
    setHidden(boolean value)
    Sets the property which specifies whether rows or columns should be hidden.
    void
    Sets the HorizontalAlignment of a cell or range.
    void
    setIndentLevel(int value)
    Sets the indent level of the specified cell(s).
    void
    setLocked(boolean value)
    Sets the property which specifies whether cells should be locked.
    void
    setMergeCells(boolean value)
    Sets the property which specifies whether cells are merged.
    void
    Sets the number format of the cells in the range.
    void
    setOrientation(int value)
    Sets the text orientation of a cell or range, which may be from -90 to 90 degrees, or 255(vertical text).
    void
    setOutlineLevel(int value)
    Sets the current outline level of the specified row or column.
    void
    Sets the reading order for the specified object.
    void
    setRowHeight(double value)
    Sets the height of the individual rows represented by this range in points.
    void
    setRowHeightInPixel(double value)
    Sets the height of the individual rows represented by this range in pixels.
    void
    setShowDetail(boolean value)
    Sets whether to show the detail (True if the outline is expanded for the specified range, so that the detail of the column or row is visible).
    void
    setShrinkToFit(boolean value)
    Sets the property which specifies whether cells will be drawn in a smaller font if needed to display the contents of the cell.
    void
    Sets the named style IStyle associated with the cells represented bythis IRange.
    void
    setTag(Object value)
    Sets the tag value of the specified range in the sheet.
    void
    setUseStandardHeight(boolean value)
    Determines if the row height of the IRange object equals the standardheight of the sheet.
    void
    setUseStandardWidth(boolean value)
    Determines if the column width of the IRange object equals thestandard width of the sheet.
    void
    Sets the value of the specified cell as a string, double, int, boolean, Date, Calendar, Object[][] or null.
    void
    Sets the VerticalAlignment of a cell or range.
    void
    setWatermark(String watermark)
    Sets the watermark for range.
    void
    setWrapText(boolean value)
    Sets the flag which indicates whether word wrap is enabled in a cell.
    void
    sort(IRange key, SortOrder order, SortOrientation orientation)
    Sorts the cells represented by this range according to the specified options.
    void
    sort(IRange key, SortOrder order, SortOrientation orientation, boolean caseSensitive)
    Sorts the cells represented by this range according to the specified options.
    void
    sort(SortOrientation orientation, boolean caseSensitive, IValueSortField... keys)
    Sorts the cells represented by this range according to the specified options.
    Gets a IRange object that represents all the cells that match the specified type and value.
    Gets a IRange object that represents all the cells that match the specified type and value.
    void
    subtotal(int groupBy, ConsolidationFunction subtotalFunction, int[] totalList)
    Creates subtotals for the range.
    void
    subtotal(int groupBy, ConsolidationFunction subtotalFunction, int[] totalList, boolean replace)
    Creates subtotals for the range.
    void
    subtotal(int groupBy, ConsolidationFunction subtotalFunction, int[] totalList, boolean replace, boolean pageBreaks)
    Creates subtotals for the range.
    void
    subtotal(int groupBy, ConsolidationFunction subtotalFunction, int[] totalList, boolean replace, boolean pageBreaks, SummaryRow summaryRowLocation)
    Creates subtotals for the range.
    void
    subtotal(int groupBy, ConsolidationFunction subtotalFunction, int[] totalList, SummaryRow summaryRowLocation)
    Creates subtotals for the range.
    void
    toImage(OutputStream stream, ImageType imageType)
    Saves the range to the specified image file.
    void
    toImage(OutputStream stream, ImageType imageType, ImageSaveOptions options)
    Saves the range to the specified image file using options.
    void
    toImage(String imageFile)
    Saves the range to the specified image file.
    void
    toImage(String imageFile, ImageSaveOptions options)
    Saves the range to the specified image file using options.
    Generates a json string from the range.
    void
    Decrements the OutlineLevel of the specified rows or columns.
    union(IRange range2)
    Returns an IRange object that represents the union of two ranges.
    union(IRange... ranges)
    Returns an IRange object that represents the union of several ranges.
    void
    Converts merged cells in the represented range to normal cells.
  • 方法详细资料

    • getRows

      IRange getRows()
      Returns the IRange object that represents the rows in the specifiedrange.
    • getColumns

      IRange getColumns()
      Returns the IRange object that represents the columns in thespecified range.
    • getCells

      IRange getCells()
      Returns the IRange object that represents the cells in the specifiedrange.
    • getRow

      int getRow()
      Returns the zero based row number of the first row.
    • getLastRow

      int getLastRow()
      Returns the zero based row number of the last row of the first range.
    • getRowCount

      int getRowCount()
      Returns the row count of the first range.
    • getColumn

      int getColumn()
      Returns the zero based column number of the last column of the first range.
    • getLastColumn

      int getLastColumn()
      Returns the zero based column number of the first column of this IRange.
    • getColumnCount

      int getColumnCount()
      Returns the column count of the first range.
    • getCount

      int getCount()
      Returns the number of objects in the collection.
    • getFont

      IFont getFont()
      Returns an instance of IFont which may be used to get and set fontproperties of the cells represented by this IRange.
    • getBorders

      IBorders getBorders()
      Returns an instance of IBorders which represents the cell borders ofthe cell or range represented by this IRange.
    • getInterior

      IInterior getInterior()
      Returns the IInterior which represents the interior (background)color and pattern of the specified cell(s).
    • getNumberFormat

      String getNumberFormat()
      Gets the number format of the cells in the range.
    • setNumberFormat

      void setNumberFormat(String value)
      Sets the number format of the cells in the range.
    • getAddIndent

      boolean getAddIndent()
      Gets the property which controls indentation of text when horizontal or vertical alignment is set to distributed.
    • setAddIndent

      void setAddIndent(boolean value)
      Sets the property which controls indentation of text when horizontal or vertical alignment is set to distributed.
    • getIndentLevel

      int getIndentLevel()
      Gets the indent level of the specified cell(s).
    • setIndentLevel

      void setIndentLevel(int value)
      Sets the indent level of the specified cell(s).
    • getHidden

      boolean getHidden()
      Gets the property which specifies whether rows or columns should be hidden.
    • setHidden

      void setHidden(boolean value)
      Sets the property which specifies whether rows or columns should be hidden.
    • getLocked

      boolean getLocked()
      Gets the property which specifies whether cells should be locked.
    • setLocked

      void setLocked(boolean value)
      Sets the property which specifies whether cells should be locked.
    • getOrientation

      int getOrientation()
      Gets the text orientation of a cell or range, which may be from -90 to 90 degrees, or 255(vertical text).
    • setOrientation

      void setOrientation(int value)
      Sets the text orientation of a cell or range, which may be from -90 to 90 degrees, or 255(vertical text).
    • getShrinkToFit

      boolean getShrinkToFit()
      Gets the property which specifies whether cells will be drawn in a smaller font if needed to display the contents of the cell.
    • setShrinkToFit

      void setShrinkToFit(boolean value)
      Sets the property which specifies whether cells will be drawn in a smaller font if needed to display the contents of the cell.
    • getWrapText

      boolean getWrapText()
      Get the flag which indicates whether word wrap is enabled in a cell.
    • setWrapText

      void setWrapText(boolean value)
      Sets the flag which indicates whether word wrap is enabled in a cell.
    • getHorizontalAlignment

      HorizontalAlignment getHorizontalAlignment()
      Gets the HorizontalAlignment of a cell or range.
    • setHorizontalAlignment

      void setHorizontalAlignment(HorizontalAlignment value)
      Sets the HorizontalAlignment of a cell or range.
    • getVerticalAlignment

      VerticalAlignment getVerticalAlignment()
      Gets the VerticalAlignment of a cell or range.
    • setVerticalAlignment

      void setVerticalAlignment(VerticalAlignment value)
      Sets the VerticalAlignment of a cell or range.
    • getDisplayFormat

      IDisplayFormat getDisplayFormat()
      Gets a DisplayFormat object that represents the display settings for the specified range.
    • getFormulaHidden

      boolean getFormulaHidden()
      Gets or Sets whether the formula will be hidden when the worksheet is protected
    • setFormulaHidden

      void setFormulaHidden(boolean value)
      Sets whether the formula will be hidden when the worksheet is protected
    • getReadingOrder

      ReadingOrder getReadingOrder()
      Gets or Sets the reading order for the specified object.
    • setReadingOrder

      void setReadingOrder(ReadingOrder value)
      Sets the reading order for the specified object.
    • getStyle

      IStyle getStyle()
      Gets the named style IStyle associated with the cells represented bythis IRange.
    • setStyle

      void setStyle(IStyle value)
      Sets the named style IStyle associated with the cells represented bythis IRange.
    • getValidation

      IValidation getValidation()
      Returns an instance of IValidation which may be used to get and setvalidation properties of the cells represented by this IRange.
    • getHyperlinks

      IHyperlinks getHyperlinks()
      Returns an instance of IValidation which may be used to get and setHyperLinks properties.
    • getComment

      IComment getComment()
      Returns an instance of IComment which may be used to get and setComment properties of the cells.
    • getSparklineGroups

      ISparklineGroups getSparklineGroups()
      Returns an instance of ISparklineGroups which may be used to get andset SparklineGroups properties of the cells
    • getWorksheet

      IWorksheet getWorksheet()
      Returns the parent IWorksheet of this range.
    • getEntireRow

      IRange getEntireRow()
      Returns a new instance of IRange which represents the same range ofcells, but expanded to include all columns.
    • getEntireColumn

      IRange getEntireColumn()
      Returns a new instance of IRange which represents the same range ofcells, but expanded to include all rows.
    • getEntireMergeArea

      IRange getEntireMergeArea()
      Returns an IRange representing the area of the current range which isiteratively grown as needed until it includes no partial merged cells.
    • getMergeArea

      IRange getMergeArea()
      Returns an IRange representing the merged range containing thespecified cell. If the specified cell isn't in a merged range, this property returns the specified cell.
    • getFormula

      String getFormula()
      Gets the formula of the cells represented by this range in A1-style notation.
    • setFormula

      void setFormula(String value)
      Sets the formula of the cells represented by this range in A1-style notation.
    • getFormulaLocal

      String getFormulaLocal()
      Gets the localized formula of the cells represented by this range in A1-style notation.
    • setFormulaLocal

      void setFormulaLocal(String value)
      Sets the localized formula of the cells represented by this range in A1-style notation.
    • getFormulaR1C1

      String getFormulaR1C1()
      Gets the formula of the cells represented by this range in R1C1-style notation.
    • setFormulaR1C1

      void setFormulaR1C1(String value)
      Sets the formula of the cells represented by this range in R1C1-style notation.
    • getFormulaR1C1Local

      String getFormulaR1C1Local()
      Gets the localized formula of the cells represented by this range in R1C1-style notation.
    • setFormulaR1C1Local

      void setFormulaR1C1Local(String value)
      Sets the localized formula of the cells represented by this range in R1C1-style notation.
    • getFormula2

      String getFormula2()
      Gets the formula of the cells represented by this range in A1-style array notation.
    • setFormula2

      void setFormula2(String value)
      Sets the formula of the cells represented by this range in A1-style array notation.
    • getFormula2Local

      String getFormula2Local()
      Gets the localized formula of the cells represented by this range in A1-style array notation.
    • setFormula2Local

      void setFormula2Local(String value)
      Sets the localized formula of the cells represented by this range in A1-style array notation.
    • getFormula2R1C1

      String getFormula2R1C1()
      Gets the formula of the cells represented by this range in R1C1-style array notation.
    • setFormula2R1C1

      void setFormula2R1C1(String value)
      Sets the formula of the cells represented by this range in R1C1-style array notation.
    • getFormula2R1C1Local

      String getFormula2R1C1Local()
      Gets the localized formula of the cells represented by this range in R1C1-style array notation.
    • setFormula2R1C1Local

      void setFormula2R1C1Local(String value)
      Sets the localized formula of the cells represented by this range in R1C1-style array notation.
    • getFormulaArray

      String getFormulaArray()
      Gets the array formula of a range.
    • setFormulaArray

      void setFormulaArray(String value)
      Sets the array formula of a range.
    • getFormulaArrayR1C1

      String getFormulaArrayR1C1()
      Gets the array formula of a range using ReferenceStyle.R1C1.
    • setFormulaArrayR1C1

      void setFormulaArrayR1C1(String value)
      Sets the array formula of a range using ReferenceStyle.R1C1.
    • getCurrentArray

      IRange getCurrentArray()
      Gets whether the specified cell is part of an array, returns an IRange object that represents the entire array.
    • getHasFormula

      boolean getHasFormula()
      Returns true if the cell or range contains any formulas; otherwise, false is returned.
    • getHasArray

      boolean getHasArray()
      Determines if the specified cell is part of an array formula.
    • getValue

      Object getValue()
      Gets the value of the specified range as a string, double, boolean, Date, Object[][] or null;
    • setValue

      void setValue(Object value)
      Sets the value of the specified cell as a string, double, int, boolean, Date, Calendar, Object[][] or null.
    • getTag

      Object getTag()
      Gets the tag value of the specified range in the sheet.
    • setTag

      void setTag(Object value)
      Sets the tag value of the specified range in the sheet.
    • getCellType

      BaseCellType getCellType()
      Gets the cell type for specified range in the sheet.
    • setCellType

      void setCellType(BaseCellType cellType)
      Sets the cell type for specified range in the sheet.
    • getBindingPath

      String getBindingPath()
      Gets the binding path of the current cell or column. If range is normal range, returns the binding path of the top-left cell of range. If range is EntireColumn, returns the binding path of the left column binding path of range. If range is EntireRow, returns null.
    • setBindingPath

      void setBindingPath(String value)
      Sets the binding path of the current cell or column. If range is normal range, sets the binding path of the top-left cell of range. If range is EntireColumn, sets the binding path of the left column binding path of range. If range is EntireRow, do nothing.
    • getText

      String getText()
      Gets the value of the cell represented by this IRange as a formatted string.
    • getAreas

      IAreas getAreas()
      Returns an instance of IAreas which represents an array of rangeswhere each range returned by areas represents one cell or range.
    • getUsedRange

      IRange getUsedRange()
      Returns an IRange representing the used range in the current range.
    • get

      IRange get(int rowOffset, int columnOffset)
      Returns a new instance of IRange which is offset from this range.
      参数:
      rowOffset - The row offset.
      columnOffset - The column offset.
      返回:
      IRange.
    • get

      IRange get(int index)
      Returns a new instance of IRange by index which represents a cell.
      参数:
      index -
    • getMergeCells

      boolean getMergeCells()
      Gets the property which specifies whether cells are merged.
    • setMergeCells

      void setMergeCells(boolean value)
      Sets the property which specifies whether cells are merged.
    • merge

      void merge()
      Merges the cells in the represented range into a single merged cell.
    • merge

      void merge(boolean isAcross)
      Merges the cells in the represented range into a single merged cell.
      参数:
      isAcross - Optional Object. True to merge cells in each row of thespecified range as separate merged cells. The default value is False.
    • unmerge

      void unmerge()
      Converts merged cells in the represented range to normal cells.
    • insert

      void insert()
      Inserts a cell or a range of cells into the worksheet and shifts other cells away to make space.
    • insert

      void insert(InsertShiftDirection shiftDirection)
      Inserts a cell or a range of cells into the worksheet and shifts other cells away to make space.
      参数:
      shiftDirection - Specifies which way to shift the cells.
    • delete

      void delete()
      Deletes a cell or a range of cells from the worksheet and shifts other cells to replace deleted cells.
    • delete

      void delete(DeleteShiftDirection shiftDirection)
      Deletes a cell or a range of cells from the worksheet and shifts other cells to replace deleted cells.
      参数:
      shiftDirection - Specifies which way to shift the cells.
    • clear

      void clear()
      Clears formulas, values, and all formatting from the current range.
    • clearContents

      void clearContents()
      Clears formulas and values from the current range.
    • clearFormats

      void clearFormats()
      Clears all formatting from the current range.
    • clearHyperlinks

      void clearHyperlinks()
      Clears all hyperLinks from the current range.
    • clearComments

      void clearComments()
      Clears the comments from the current range
    • clearCommentsThreaded

      void clearCommentsThreaded()
      Clears the threaded comments from the current range.
    • addComment

      IComment addComment(String text)
      Adds comments to the current range.
      参数:
      text - The text you want to add.
    • sort

      void sort(SortOrientation orientation, boolean caseSensitive, IValueSortField... keys)
      Sorts the cells represented by this range according to the specified options.
      参数:
      orientation - The orientation.
      caseSensitive - if set to true, case sensitive.
      keys - The IValueSortField array.
    • sort

      void sort(IRange key, SortOrder order, SortOrientation orientation, boolean caseSensitive)
      Sorts the cells represented by this range according to the specified options.
      参数:
      key - The key of the sort column.
      order - The sort order, ascending or dscending
      orientation - The orientation.
      caseSensitive - if set to true, case sensitive.
    • sort

      void sort(IRange key, SortOrder order, SortOrientation orientation)
      Sorts the cells represented by this range according to the specified options.
      参数:
      key - The key of the sort column.
      order - The sort order, ascending or dscending
      orientation - The orientation.
    • autoFilter

      void autoFilter(int field, Object criteria1, AutoFilterOperator op, Object criteria2, boolean visibleDropDown)
      Filters a list using the AutoFilter.
      参数:
      field - Optional Object. The integer offset of the field onwhich you want to base the filter (from the left of the list; the leftmost field is field zero).
      criteria1 - Optional Object. The criteria (a string; for example,"101"). Use "=" to find blank fields, or use " <>" to find nonblank fields. If this argument is omitted, the criteria is All. If Operator is xlTop10Items, Criteria1 specifies the number of items (for example, "10").
      op - Optional AutoFilterOperator
      criteria2 - Optional Object. The second criteria (a string). Usedwith Criteria1 and Operator to construct compound criteria.
      visibleDropDown - Optional Object. True to display the AutoFilterdrop-down arrow for the filtered field; False to hide the AutoFilter drop-down arrow for the filtered field. True by default.
    • autoFilter

      void autoFilter(int field)
      Filters a list using the AutoFilter.
      参数:
      field - Optional Object. The integer offset of the field on which youwant to base the filter (from the left of the list; the leftmost field is field zero).
    • autoFilter

      void autoFilter()
      Filters a list using the AutoFilter.
      Add a filter with no condition if there's no filter in the sheet.
      Or show all the data in the first column of the filter.
    • autoFilter

      void autoFilter(int field, Object criteria1)
      Filters a list using the AutoFilter.
      参数:
      field - Optional Object. The integer offset of the field on whichyou want to base the filter (from the left of the list; the leftmost field is field zero).
      criteria1 - Optional Object. The criteria (a string; for example,"101"). Use "=" to find blank fields, or use " <>" to find nonblank fields. If this argument is omitted, the criteria is All. If Operator is xlTop10Items, Criteria1 specifies the number of items (for example, "10").
    • autoFilter

      void autoFilter(int field, Object criteria1, AutoFilterOperator op)
      Filters a list using the AutoFilter.
      参数:
      field - Optional Object. The integer offset of the field on whichyou want to base the filter (from the left of the list; the leftmost field is field zero).
      criteria1 - Optional Object. The criteria (a string; for example,"101"). Use "=" to find blank fields, or use " <>" to find nonblank fields. If this argument is omitted, the criteria is All. If Operator is xlTop10Items, Criteria1 specifies the number of items (for example, "10").
      op - Optional AutoFilterOperator
    • autoFilter

      void autoFilter(int field, Object criteria1, AutoFilterOperator op, Object criteria2)
      Filters a list using the AutoFilter.
      参数:
      field - Optional Object. The integer offset of the field on whichyou want to base the filter (from the left of the list; the leftmost field is field zero).
      criteria1 - Optional Object. The criteria (a string; for example,"101"). Use "=" to find blank fields, or use " <>" to find nonblank fields. If this argument is omitted, the criteria is All. If Operator is xlTop10Items, Criteria1 specifies the number of items (for example, "10").
      op - Optional AutoFilterOperator
      criteria2 - Optional Object. The second criteria (a string). Used withCriteria1 and Operator to construct compound criteria.
    • getWidth

      double getWidth()
      Gets the width, in points, of the range.
    • getWidthInPixel

      double getWidthInPixel()
      Gets the width, in pixels, of the range.
    • getColumnWidth

      double getColumnWidth()
      Gets the width of the individual columns represented in this range in characters.
    • setColumnWidth

      void setColumnWidth(double value)
      Sets the width of the individual columns represented in this range in characters.
    • getColumnWidthInPixel

      double getColumnWidthInPixel()
      Gets the width of the individual columns represented in this range in pixels.
    • setColumnWidthInPixel

      void setColumnWidthInPixel(double value)
      Sets the width of the individual columns represented in this range in pixels.
    • getHeight

      double getHeight()
      Gets the height, in points, of the range.
    • getHeightInPixel

      double getHeightInPixel()
      Gets the height, in pixels, of the range.
    • getRowHeight

      double getRowHeight()
      Gets the height of the individual rows represented by this range in points.
    • setRowHeight

      void setRowHeight(double value)
      Sets the height of the individual rows represented by this range in points.
    • getRowHeightInPixel

      double getRowHeightInPixel()
      Gets the height of the individual rows represented by this range in pixels.
    • setRowHeightInPixel

      void setRowHeightInPixel(double value)
      Sets the height of the individual rows represented by this range in pixels.
    • getFormatConditions

      IFormatConditions getFormatConditions()
      Returns a FormatConditions collection that represents all the conditional formats for the specified range.
    • clearOutline

      void clearOutline()
      Clears the outline for the specified range.
    • group

      void group()
      Increments the OutlineLevel of the specified rows or columns.
    • ungroup

      void ungroup()
      Decrements the OutlineLevel of the specified rows or columns.
    • getOutlineLevel

      int getOutlineLevel()
      Gets the current outline level of the specified row or column.
    • setOutlineLevel

      void setOutlineLevel(int value)
      Sets the current outline level of the specified row or column.
    • getShowDetail

      boolean getShowDetail()
      Gets whether to show the detail (True if the outline is expanded for the specified range, so that the detail of the column or row is visible). The specified range must be a single summary column or row in an outline.

      The following statements are true: 1.The range must be in a single summary row or column. 2.This property returns False if any of the children of the row or column are hidden. 3.Setting this property to True is equivalent to unhiding all the children of the summary row or column. 4.Setting this property to False is equivalent to hiding all the children of the summary row or column.

    • setShowDetail

      void setShowDetail(boolean value)
      Sets whether to show the detail (True if the outline is expanded for the specified range, so that the detail of the column or row is visible). The specified range must be a single summary column or row in an outline.

      The following statements are true: 1.The range must be in a single summary row or column. 2.This property returns False if any of the children of the row or column are hidden. 3.Setting this property to True is equivalent to unhiding all the children of the summary row or column. 4.Setting this property to False is equivalent to hiding all the children of the summary row or column.

    • getSummary

      boolean getSummary()
      Determines if the range is an outlining summary row or column.
    • activate

      void activate()
      Activates a single cell, which must be inside the current selection.
    • select

      void select()
      Selects the object.
    • copy

      void copy(IRange destination)
      Copies the range to the specified range
    • copy

      void copy(IRange destination, PasteOption pasteOption)
      Copies the range to the specified range.
      参数:
      destination - Specifies the new range to which the specified range willbe pasted. It can be the range of the same or another workbook.
      pasteOption - Specifies the part of the range to be pasted andwhether to include hidden range.
    • cut

      void cut(IRange destination)
      Cuts the range to the specified range.
      参数:
      destination - Specifies the new range to which the specified range willbe pasted. It can be the range of the same or another workbook.
    • getHasValidation

      boolean getHasValidation()
      Returns true if any of the cells represented by this range have data validation associated with them.
    • getValidationIsSame

      boolean getValidationIsSame()
      Returns true if the validation options of all cells represented by this IRange are the same; otherwise, false is returned.
    • getUseStandardHeight

      boolean getUseStandardHeight()
      Determines if the row height of the IRange object equals the standardheight of the sheet.
    • setUseStandardHeight

      void setUseStandardHeight(boolean value)
      Determines if the row height of the IRange object equals the standardheight of the sheet.
    • getUseStandardWidth

      boolean getUseStandardWidth()
      Determines if the column width of the IRange object equals thestandard width of the sheet.
    • setUseStandardWidth

      void setUseStandardWidth(boolean value)
      Determines if the column width of the IRange object equals thestandard width of the sheet.
    • calculate

      void calculate()
      Calculates formulas of the range as needed.
    • dirty

      void dirty()
      Designates all the formulas of the range to be recalculated when the next calculation occurs.
    • isRichText

      boolean isRichText()
      Indicates whether the cell string value is a rich text.
    • getRichText

      IRichText getRichText()
      Gets the rich text object associate with the top-left cell of this range.
    • characters

      ITextRun characters(int startIndex, int length)
      Returns a ITextRun object that represents a range of characters within the cell text.
    • find

      IRange find(Object what, IRange after, FindOptions options)
      Finds specific information in a range.
      参数:
      what - The data to search for. Can be a String, double, Date,Calendar, boolean or int.
      after - The cell after which you want the search to begin. Thiscorresponds to the position of the active cell when a search is done from the user interface. Notice that After must be a single cell in the range. Remember that the search begins after this cell; the specified cell isn't searched until the method wraps back around to this cell. If you do not specify this argument, the search starts at the cell in the upper-left corner of the range when FindOptions.SearchDirection is SearchDirection.Next, or at the cell in the bottom-right corner of the range when FindOptions.SearchDirection is SearchDirection.Previous.
      options - The find options
      返回:
      A IRange object that represents the first cell where that informationis found.
    • find

      IRange find(Object what, IRange after)
      Finds specific information in a range.
      参数:
      what - The data to search for. Can be a String, double, Date,LocalDateTime, Calendar, boolean or int.
      after - The cell after which you want the search to begin. Thiscorresponds to the position of the active cell when a search is done from the user interface. Notice that After must be a single cell in the range. Remember that the search begins after this cell; the specified cell isn't searched until the method wraps back around to this cell. If you do not specify this argument, the search starts at the cell in the upper-left corner of the range when FindOptions.SearchDirection is SearchDirection.Next, or at the cell in the bottom-right corner of the range when FindOptions.SearchDirection is SearchDirection.Previous.
      返回:
      A IRange object that represents the first cell where that informationis found.
    • find

      IRange find(Object what)
      Finds specific information in a range, starts from the upper-left corner.
      参数:
      what - The data to search for. Can be a String, double, Date,LocalDateTime, Calendar, boolean or int.
      返回:
      A IRange object that represents the first cell where that informationis found.
    • find

      IRange find(Object what, FindOptions options)
      Finds specific information in a range, starts from the upper-left corner.
      参数:
      what - The data to search for. Can be a String, double, Date,LocalDateTime, Calendar, boolean or int.
      options - The find options
      返回:
      A IRange object that represents the first cell where that informationis found.
    • replace

      int replace(Object what, Object replacement)
      Search in formulas and replace. Using this method doesn't change either the selection or the active cell.
      参数:
      what - The string you want to search for.
      replacement - The replacement string.
      返回:
      Number of cells that was replaced.
    • replace

      int replace(Object what, Object replacement, ReplaceOptions options)
      Search in formulas and replace. Using this method doesn't change either the selection or the active cell.
      参数:
      what - The string you want to search for.
      replacement - The replacement string.
      options - The replace options.
      返回:
      Number of cells that was replaced.
    • autoFit

      void autoFit()
      Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit.
    • autoFit

      void autoFit(boolean considerMergedCell)
      Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit.
      参数:
      considerMergedCell - Indicates whether to consider merged cells in a single row.
    • subtotal

      void subtotal(int groupBy, ConsolidationFunction subtotalFunction, int[] totalList)
      Creates subtotals for the range.
      参数:
      groupBy - The field to group by, as a one-based integer offset.
      subtotalFunction - The subtotal function.
      totalList - An array of 1-based field offsets, indicating the fields to which the subtotals are added.
    • subtotal

      void subtotal(int groupBy, ConsolidationFunction subtotalFunction, int[] totalList, boolean replace)
      Creates subtotals for the range.
      参数:
      groupBy - The field to group by, as a one-based integer offset.
      subtotalFunction - The subtotal function.
      totalList - An array of 1-based field offsets, indicating the fields to which the subtotals are added.
      replace - True to replace existing subtotals. The default value is True.
    • subtotal

      void subtotal(int groupBy, ConsolidationFunction subtotalFunction, int[] totalList, boolean replace, boolean pageBreaks)
      Creates subtotals for the range.
      参数:
      groupBy - The field to group by, as a one-based integer offset.
      subtotalFunction - The subtotal function.
      totalList - An array of 1-based field offsets, indicating the fields to which the subtotals are added.
      replace - True to replace existing subtotals. The default value is True.
      pageBreaks - True to add page breaks after each group. The default value is False.
    • subtotal

      void subtotal(int groupBy, ConsolidationFunction subtotalFunction, int[] totalList, SummaryRow summaryRowLocation)
      Creates subtotals for the range.
      参数:
      groupBy - The field to group by, as a one-based integer offset.
      subtotalFunction - The subtotal function.
      totalList - An array of 1-based field offsets, indicating the fields to which the subtotals are added.
      summaryRowLocation - Places the summary data relative to the subtotal. The default value is Below.
    • subtotal

      void subtotal(int groupBy, ConsolidationFunction subtotalFunction, int[] totalList, boolean replace, boolean pageBreaks, SummaryRow summaryRowLocation)
      Creates subtotals for the range.
      参数:
      groupBy - The field to group by, as a one-based integer offset.
      subtotalFunction - The subtotal function.
      totalList - An array of 1-based field offsets, indicating the fields to which the subtotals are added.
      replace - True to replace existing subtotals. The default value is True.
      pageBreaks - True to add page breaks after each group. The default value is False.
      summaryRowLocation - Places the summary data relative to the subtotal. The default value is Below.
    • removeSubtotal

      void removeSubtotal()
      Removes subtotals from a list.
    • toImage

      void toImage(String imageFile)
      Saves the range to the specified image file.
      参数:
      imageFile - The output image file.
    • toImage

      void toImage(String imageFile, ImageSaveOptions options)
      Saves the range to the specified image file using options.
      参数:
      imageFile - The output image file.
      options - The options for output image.
    • toImage

      void toImage(OutputStream stream, ImageType imageType)
      Saves the range to the specified image file.
      参数:
      stream - The output image stream.
      imageType - Specifies the type of image to create.
    • toImage

      void toImage(OutputStream stream, ImageType imageType, ImageSaveOptions options)
      Saves the range to the specified image file using options.
      参数:
      stream - The output image stream.
      imageType - Specifies the type of image to create.
      options - The options for output image.
    • getAddress

      String getAddress()
      Returns a String value that represents the range reference.
    • getAddress

      String getAddress(boolean rowAbsolute, boolean columnAbsolute)
      Returns a String value that represents the range reference.
      参数:
      columnAbsolute - True to return the column part of the reference as an absolute reference.The default value is true.
      rowAbsolute - True to return the row part of the reference as an absolute reference.The default value is true.
    • getAddress

      String getAddress(boolean rowAbsolute, boolean columnAbsolute, ReferenceStyle referenceStyle)
      Returns a String value that represents the range reference.
      参数:
      columnAbsolute - True to return the column part of the reference as an absolute reference.The default value is true.
      rowAbsolute - True to return the row part of the reference as an absolute reference.The default value is true.
      referenceStyle - The reference style. The default value is A1.
    • getAddress

      String getAddress(boolean rowAbsolute, boolean columnAbsolute, ReferenceStyle referenceStyle, IRange relativeTo)
      Returns a String value that represents the range reference.
      参数:
      columnAbsolute - True to return the column part of the reference as an absolute reference.The default value is true.
      rowAbsolute - True to return the row part of the reference as an absolute reference.The default value is true.
      referenceStyle - The reference style. The default value is A1.
      relativeTo - If RowAbsolute and ColumnAbsolute are false,and ReferenceStyle is R1C1, defines a starting point for the relative reference. The default reference is $A$1.
    • specialCells

      IRange specialCells(SpecialCellType type)
      Gets a IRange object that represents all the cells that match the specified type and value.
    • specialCells

      IRange specialCells(SpecialCellType type, SpecialCellsValue value)
      Gets a IRange object that represents all the cells that match the specified type and value.
    • getCellPadding

      ICellPadding getCellPadding()
      Gets the cell padding for range.
      返回:
      An ICellPadding objectSpreadJS only.
    • setCellPadding

      void setCellPadding(ICellPadding cellPadding)
      Sets the cell padding for range.
      参数:
      cellPadding - SpreadJS only.
    • getWatermark

      String getWatermark()
      Gets the watermark for range.
      返回:
      the watermark stringSpreadJS only.
    • setWatermark

      void setWatermark(String watermark)
      Sets the watermark for range.
      参数:
      watermark - SpreadJS only.
    • getLabelOptions

      ILabelOptions getLabelOptions()
      Gets the setting for watermark.
      返回:
      An ILabelOptions objectSpreadJS only.
    • fromJson

      void fromJson(String json)
      Generates the range data from the json string.
      参数:
      json - the json string that contains range info.
    • toJson

      String toJson()
      Generates a json string from the range.
      返回:
      the json string that contains range info.
    • addCommentThreaded

      ICommentThreaded addCommentThreaded(String text)
      Adds a threaded comment to the range.
      参数:
      text - The string is content of the threaded comment.
    • addCommentThreaded

      ICommentThreaded addCommentThreaded(String text, String author)
      Adds a threaded comment to the range.
      参数:
      text - The string is content of the threaded comment.
      author - Author name of the threaded comment.
      返回:
    • getCommentThreaded

      ICommentThreaded getCommentThreaded()
      返回:
      Gets the threaded comment of specific cell
    • generateGetPivotDataFunction

      String generateGetPivotDataFunction(IRange destination)
      Generate the corresponding function "GETPIVOTDATA" for the cells in the pivot table.
      参数:
      destination - Indicates for which area the "GETPIVOTDATA" function is generated.
      返回:
      "GETPIVOTDATA" function
    • generateGetPivotDataFunction

      String generateGetPivotDataFunction()
      Generate the corresponding function "GETPIVOTDATA" for the cells in the pivot table.
      返回:
      "GETPIVOTDATA" function
    • intersect

      IRange intersect(IRange range2)
      Returns an IRange object that represents the intersection of two ranges.
      If range2 is from a different worksheet, an exception is thrown.
      参数:
      range2 - The range to intersect with this range.
      返回:
      A new range which consists of the intersection of this range and range2, or null if the ranges do not intersect.
    • intersect

      IRange intersect(IRange... ranges)
      Returns an IRange object that represents the intersection of several ranges.
      If one or more ranges from a different worksheet are specified, an exception is thrown.
      参数:
      ranges - The intersecting ranges.
      返回:
      A new range which consists of the intersection of this range and other ranges, or null if the ranges do not intersect.
    • union

      IRange union(IRange range2)
      Returns an IRange object that represents the union of two ranges.
      If range2 is from a different worksheet, an exception is thrown.
      参数:
      range2 - The range to union with this range.
      返回:
      A new range which consists of the union of this range and range2.
    • union

      IRange union(IRange... ranges)
      Returns an IRange object that represents the union of several ranges.
      If one or more ranges from a different worksheet are specified, an exception is thrown.
      参数:
      ranges - Other ranges to union with this range.
      返回:
      A new range which consists of the union of this range and other ranges.
    • offset

      IRange offset(int rowOffset, int columnOffset)
      Returns an IRange object that represents the offset of this range.
      参数:
      rowOffset - Row offset.
      columnOffset - Column offset.
      返回:
      A new range which consists of the offset of this range.