接口 IRange
-
方法概要
修饰符和类型方法说明void
activate()
Activates a single cell, which must be inside the current selection.addComment
(String text) Adds comments to the current range.addCommentThreaded
(String text) Adds a threaded comment to the range.addCommentThreaded
(String text, String author) 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
autoFit()
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
clear()
Clears formulas, values, and all formatting from the current range.void
Clears the comments from the current rangevoid
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
Copies the range to the specified rangevoid
copy
(IRange destination, PasteOption pasteOption) Copies the range to the specified range.void
Cuts the range to the specified range.void
delete()
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
dirty()
Designates all the formulas of the range to be recalculated when the next calculation occurs.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.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.generateGetPivotDataFunction
(IRange destination) Generate the corresponding function "GETPIVOTDATA" for the cells in the pivot table.get
(int index) Returns a new instance ofIRange
by index which represents a cell.get
(int rowOffset, int columnOffset) Returns a new instance ofIRange
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.getAreas()
Returns an instance ofIAreas
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 ofIBorders
which represents the cell borders ofthe cell or range represented by this IRange.Gets the cell padding for range.getCells()
Returns theIRange
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 theIRange
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 ofIComment
which may be used to get and setComment properties of the cells.int
getCount()
Returns the number of objects in the collection.Gets whether the specified cell is part of an array, returns anIRange
object that represents the entire array.Gets a DisplayFormat object that represents the display settings for the specified range.Returns a new instance ofIRange
which represents the same range ofcells, but expanded to include all rows.Returns anIRange
representing the area of the current range which isiteratively grown as needed until it includes no partial merged cells.Returns a new instance ofIRange
which represents the same range ofcells, but expanded to include all columns.getFont()
Returns an instance ofIFont
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 protectedGets 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 theHorizontalAlignment
of a cell or range.Returns an instance ofIValidation
which may be used to get and setHyperLinks properties.int
Gets the indent level of the specified cell(s).Returns theIInterior
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 anIRange
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
getRow()
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.getRows()
Returns theIRange
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 ofISparklineGroups
which may be used to get andset SparklineGroups properties of the cellsgetStyle()
Gets the named styleIStyle
associated with the cells represented bythis IRange.boolean
Determines if the range is an outlining summary row or column.getTag()
Gets the tag value of the specified range in the sheet.getText()
Gets the value of the cell represented by this IRange as a formatted string.Returns anIRange
representing the used range in the current range.boolean
Determines if the row height of theIRange
object equals the standardheight of the sheet.boolean
Determines if the column width of theIRange
object equals thestandard width of the sheet.Returns an instance ofIValidation
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 thisIRange
are the same; otherwise, false is returned.getValue()
Gets the value of the specified range as a string, double, boolean,Date
, Object[][] or null;Gets theVerticalAlignment
of a cell or range.Gets the watermark for range.double
getWidth()
Gets the width, in points, of the range.double
Gets the width, in pixels, of the range.Returns the parentIWorksheet
of this range.boolean
Get the flag which indicates whether word wrap is enabled in a cell.void
group()
Increments the OutlineLevel of the specified rows or columns.void
insert()
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.Returns an IRange object that represents the intersection of two ranges.Returns an IRange object that represents the intersection of several ranges.boolean
Indicates whether the cell string value is a rich text.void
merge()
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
Search in formulas and replace.int
replace
(Object what, Object replacement, ReplaceOptions options) Search in formulas and replace.void
select()
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
setBindingPath
(String value) Sets the binding path of the current cell or column.void
setCellPadding
(ICellPadding cellPadding) Sets the cell padding for range.void
setCellType
(BaseCellType cellType) 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
setFormula
(String value) Sets the formula of the cells represented by this range in A1-style notation.void
setFormula2
(String value) Sets the formula of the cells represented by this range in A1-style array notation.void
setFormula2Local
(String value) Sets the localized formula of the cells represented by this range in A1-style array notation.void
setFormula2R1C1
(String value) Sets the formula of the cells represented by this range in R1C1-style array notation.void
setFormula2R1C1Local
(String value) Sets the localized formula of the cells represented by this range in R1C1-style array notation.void
setFormulaArray
(String value) Sets the array formula of a range.void
setFormulaArrayR1C1
(String value) 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 protectedvoid
setFormulaLocal
(String value) Sets the localized formula of the cells represented by this range in A1-style notation.void
setFormulaR1C1
(String value) Sets the formula of the cells represented by this range in R1C1-style notation.void
setFormulaR1C1Local
(String value) 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 theHorizontalAlignment
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
setNumberFormat
(String value) 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
setReadingOrder
(ReadingOrder value) 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 styleIStyle
associated with the cells represented bythis IRange.void
Sets the tag value of the specified range in the sheet.void
setUseStandardHeight
(boolean value) Determines if the row height of theIRange
object equals the standardheight of the sheet.void
setUseStandardWidth
(boolean value) Determines if the column width of theIRange
object equals thestandard width of the sheet.void
void
Sets theVerticalAlignment
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.specialCells
(SpecialCellType type) Gets a IRange object that represents all the cells that match the specified type and value.specialCells
(SpecialCellType type, SpecialCellsValue 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
Saves the range to the specified image file.void
toImage
(String imageFile, ImageSaveOptions options) Saves the range to the specified image file using options.toJson()
Generates a json string from the range.void
ungroup()
Decrements the OutlineLevel of the specified rows or columns.Returns an IRange object that represents the union of two ranges.Returns an IRange object that represents the union of several ranges.void
unmerge()
Converts merged cells in the represented range to normal cells.
-
方法详细资料
-
getRows
IRange getRows()Returns theIRange
object that represents the rows in the specifiedrange. -
getColumns
IRange getColumns()Returns theIRange
object that represents the columns in thespecified range. -
getCells
IRange getCells()Returns theIRange
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 ofIFont
which may be used to get and set fontproperties of the cells represented by this IRange. -
getBorders
IBorders getBorders()Returns an instance ofIBorders
which represents the cell borders ofthe cell or range represented by this IRange. -
getInterior
IInterior getInterior()Returns theIInterior
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
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 theHorizontalAlignment
of a cell or range. -
setHorizontalAlignment
Sets theHorizontalAlignment
of a cell or range. -
getVerticalAlignment
VerticalAlignment getVerticalAlignment()Gets theVerticalAlignment
of a cell or range. -
setVerticalAlignment
Sets theVerticalAlignment
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
Sets the reading order for the specified object. -
getStyle
IStyle getStyle()Gets the named styleIStyle
associated with the cells represented bythis IRange. -
setStyle
Sets the named styleIStyle
associated with the cells represented bythis IRange. -
getValidation
IValidation getValidation()Returns an instance ofIValidation
which may be used to get and setvalidation properties of the cells represented by this IRange. -
getHyperlinks
IHyperlinks getHyperlinks()Returns an instance ofIValidation
which may be used to get and setHyperLinks properties. -
getComment
IComment getComment()Returns an instance ofIComment
which may be used to get and setComment properties of the cells. -
getSparklineGroups
ISparklineGroups getSparklineGroups()Returns an instance ofISparklineGroups
which may be used to get andset SparklineGroups properties of the cells -
getWorksheet
IWorksheet getWorksheet()Returns the parentIWorksheet
of this range. -
getEntireRow
IRange getEntireRow()Returns a new instance ofIRange
which represents the same range ofcells, but expanded to include all columns. -
getEntireColumn
IRange getEntireColumn()Returns a new instance ofIRange
which represents the same range ofcells, but expanded to include all rows. -
getEntireMergeArea
IRange getEntireMergeArea()Returns anIRange
representing the area of the current range which isiteratively grown as needed until it includes no partial merged cells. -
getMergeArea
IRange getMergeArea()Returns anIRange
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
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
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
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
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
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
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
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
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
Sets the array formula of a range. -
getFormulaArrayR1C1
String getFormulaArrayR1C1()Gets the array formula of a range using ReferenceStyle.R1C1. -
setFormulaArrayR1C1
Sets the array formula of a range using ReferenceStyle.R1C1. -
getCurrentArray
IRange getCurrentArray()Gets whether the specified cell is part of an array, returns anIRange
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
-
getTag
Object getTag()Gets the tag value of the specified range in the sheet. -
setTag
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
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
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 ofIAreas
which represents an array of rangeswhere each range returned by areas represents one cell or range. -
getUsedRange
IRange getUsedRange()Returns anIRange
representing the used range in the current range. -
get
Returns a new instance ofIRange
which is offset from this range.- 参数:
rowOffset
- The row offset.columnOffset
- The column offset.- 返回:
- IRange.
-
get
Returns a new instance ofIRange
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
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
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
Adds comments to the current range.- 参数:
text
- The text you want to add.
-
sort
Sorts the cells represented by this range according to the specified options.- 参数:
orientation
- The orientation.caseSensitive
- if set to true, case sensitive.keys
- TheIValueSortField
array.
-
sort
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 dscendingorientation
- The orientation.caseSensitive
- if set to true, case sensitive.
-
sort
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 dscendingorientation
- 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 AutoFilterOperatorcriteria2
- 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
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
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
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 AutoFilterOperatorcriteria2
- 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
Copies the range to the specified range -
copy
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
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 thisIRange
are the same; otherwise, false is returned. -
getUseStandardHeight
boolean getUseStandardHeight()Determines if the row height of theIRange
object equals the standardheight of the sheet. -
setUseStandardHeight
void setUseStandardHeight(boolean value) Determines if the row height of theIRange
object equals the standardheight of the sheet. -
getUseStandardWidth
boolean getUseStandardWidth()Determines if the column width of theIRange
object equals thestandard width of the sheet. -
setUseStandardWidth
void setUseStandardWidth(boolean value) Determines if the column width of theIRange
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
Returns a ITextRun object that represents a range of characters within the cell text. -
find
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
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
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
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
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
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
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
Saves the range to the specified image file.- 参数:
imageFile
- The output image file.
-
toImage
Saves the range to the specified image file using options.- 参数:
imageFile
- The output image file.options
- The options for output image.
-
toImage
Saves the range to the specified image file.- 参数:
stream
- The output image stream.imageType
- Specifies the type of image to create.
-
toImage
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
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
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
Gets a IRange object that represents all the cells that match the specified type and value. -
specialCells
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
Sets the cell padding for range.- 参数:
cellPadding
- SpreadJS only.
-
getWatermark
String getWatermark()Gets the watermark for range.- 返回:
- the watermark stringSpreadJS only.
-
setWatermark
Sets the watermark for range.- 参数:
watermark
- SpreadJS only.
-
getLabelOptions
ILabelOptions getLabelOptions()Gets the setting for watermark.- 返回:
- An
ILabelOptions
objectSpreadJS only.
-
fromJson
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
Adds a threaded comment to the range.- 参数:
text
- The string is content of the threaded comment.
-
addCommentThreaded
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
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
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
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
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
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
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.
-