asposecells.api
Class Range

Encapsulates the object that represents a range of cells within a spreadsheet.

Property Getters/Setters Summary
methodgetAddress()
           Gets address of the range.
methodgetCellCount()
           Gets all cell count in the range.
methodgetColumnCount()
           Gets the count of columns in the range.
methodgetColumnWidth()
methodsetColumnWidth(value)
           Sets or gets the column width of this range
methodgetEntireColumn()
           Gets a Range object that represents the entire column (or columns) that contains the specified range.
methodgetEntireRow()
           Gets a Range object that represents the entire row (or rows) that contains the specified range.
methodgetFirstColumn()
           Gets the index of the first column of the range.
methodgetFirstRow()
           Gets the index of the first row of the range.
methodgetHyperlinks()
           Gets all hyperlink in the range.
methodgetName()
methodsetName(value)
           Gets or sets the name of the range.
methodgetRefersTo()
           Gets the range's refers to.
methodgetRowCount()
           Gets the count of rows in the range.
methodgetRowHeight()
methodsetRowHeight(value)
           Sets or gets the height of rows in this range
methodgetValue()
methodsetValue(value)
           Gets and sets the value of the range.
methodgetWorksheet()
           Gets the Worksheetobject which contains this range.
methodget(rowOffset, columnOffset)
           Gets Cell object in this range.
 
Method Summary
methodapplyStyle(style, flag)
           Applies formats for a whole range.
methodcopy(range)
           Copies data (including formulas), formatting, drawing objects etc. from a source range.
methodcopy(range, options)
           Copying the range with paste special options.
methodcopyData(range)
           Copies cell data (including formulas) from a source range.
methodcopyStyle(range)
           Copies style settings from a source range.
methodcopyValue(range)
           Copies cell value from a source range.
methodgetCellOrNull(rowOffset, columnOffset)
           Gets Cell object or null in this range.
methodgetOffset(rowOffset, columnOffset)
           Gets Range range by offset.
methodintersect(range)
           Returns a Range object that represents the rectangular intersection of two ranges.
methodisIntersect(range)
           Indicates whether the range is intersect.
methoditerator()
           Gets the enumerator for cells in this Range.
methodmerge()
           Combines a range of cells into a single cell.
methodmoveTo(destRow, destColumn)
           Move the current range to the dest range.
methodputValue(stringValue, isConverted, setStyle)
           Puts a value into the range, if appropriate the value will be converted to other data type and cell's number format will be reset.
methodsetOutlineBorder(borderEdge, borderStyle, borderColor)
           Sets outline border around a range of cells.
methodsetOutlineBorders(borderStyle, borderColor)
           Sets the outline borders around a range of cells with same border style and color.
methodsetOutlineBorders(borderStyles, borderColors)
           Sets out line borders around a range of cells.
methodsetStyle(style)
           Sets the style of the range.
methodtoString()
           Returns a string represents the current Range object.
methodunion(range)
           Returns the union of two ranges.
methodunMerge()
           Unmerges merged cells of this range.
 

Property Getters/Setters Detail

getHyperlinks : Hyperlink[] 

Hyperlink[] getHyperlinks()
Gets all hyperlink in the range.

getRowCount : int 

int getRowCount()
Gets the count of rows in the range.

getColumnCount : int 

int getColumnCount()
Gets the count of columns in the range.

getCellCount : int 

int getCellCount()
Gets all cell count in the range.

getName/setName : String 

String getName() / setName(value)
Gets or sets the name of the range. Named range is supported. For example,

range.Name = "Sheet1!MyRange";


getRefersTo : String 

String getRefersTo()
Gets the range's refers to.

getAddress : String 

String getAddress()
Gets address of the range.

getFirstRow : int 

int getFirstRow()
Gets the index of the first row of the range.

getFirstColumn : int 

int getFirstColumn()
Gets the index of the first column of the range.

getValue/setValue : Object 

Object getValue() / setValue(value)
Gets and sets the value of the range. If the range contains multiple cells, return a two-dimension System.Array object. If applies object array to the range, it should be a two-dimension System.Array object.

getColumnWidth/setColumnWidth : float 

float getColumnWidth() / setColumnWidth(value)
Sets or gets the column width of this range

getRowHeight/setRowHeight : float 

float getRowHeight() / setRowHeight(value)
Sets or gets the height of rows in this range

getEntireColumn : Range 

Range getEntireColumn()
Gets a Range object that represents the entire column (or columns) that contains the specified range.

getEntireRow : Range 

Range getEntireRow()
Gets a Range object that represents the entire row (or rows) that contains the specified range.

getWorksheet : Worksheet 

Worksheet getWorksheet()
Gets the Worksheetobject which contains this range.

get : Cell 

Cell get(rowOffset, columnOffset)
Gets Cell object in this range.
Parameters:
rowOffset - Row offset in this range, zero based.
columnOffset - Column offset in this range, zero based.
Returns:
Cell object.

Method Detail

iterator

Iterator iterator()
Gets the enumerator for cells in this Range. When traversing elements by the returned Enumerator, the cells collection should not be modified(such as operations that will cause new Cell/Row be instantiated or existing Cell/Row be deleted). Otherwise the enumerator may not be able to traverse all cells correctly(some elements may be traversed repeatedly or skipped).
Returns:
The cells enumerator

isIntersect

boolean isIntersect(range)
Indicates whether the range is intersect. If the two rangs area not in the same worksheet ,return false.
Parameters:
range: Range - The range.
Returns:
Whether the range is intersect.

intersect

Range intersect(range)
Returns a Range object that represents the rectangular intersection of two ranges. If the two ranges are not intersected, returns null.
Parameters:
range: Range - The intersecting range.
Returns:
a Range object

union

ArrayList union(range)
Returns the union of two ranges.
Parameters:
range: Range - The range
Returns:
The union of two ranges.

merge

 merge()
Combines a range of cells into a single cell. Reference the merged cell via the address of the upper-left cell in the range.

unMerge

 unMerge()
Unmerges merged cells of this range.

putValue

 putValue(stringValue, isConverted, setStyle)
Puts a value into the range, if appropriate the value will be converted to other data type and cell's number format will be reset.
Parameters:
stringValue: String - Input value
isConverted: boolean - True: converted to other data type if appropriate.
setStyle: boolean - True: set the number format to cell's style when converting to other data type

applyStyle

 applyStyle(style, flag)
Applies formats for a whole range. Each cell in this range will contains a Style object. So this is a memory-consuming method. Please use it carefully.
Parameters:
style: Style - The style object which will be applied.
flag: StyleFlag - Flags which indicates applied formatting properties.

setStyle

 setStyle(style)
Sets the style of the range.
Parameters:
style: Style - The Style object.

setOutlineBorders

 setOutlineBorders(borderStyle, borderColor)
Sets the outline borders around a range of cells with same border style and color.
Parameters:
borderStyle: int - A CellBorderType value. Border style.
borderColor: Color - Border color.

setOutlineBorders

 setOutlineBorders(borderStyles, borderColors)
Sets out line borders around a range of cells. Both the length of borderStyles and borderStyles must be 4. The order of of borderStyles and borderStyles must be top,bottom,left,right
Parameters:
borderStyles: Number Array - Border styles.
borderColors: Color[] - Border colors.

setOutlineBorder

 setOutlineBorder(borderEdge, borderStyle, borderColor)
Sets outline border around a range of cells.
Parameters:
borderEdge: int - A BorderType value. Border edge.
borderStyle: int - A CellBorderType value. Border style.
borderColor: Color - Border color.

moveTo

 moveTo(destRow, destColumn)
Move the current range to the dest range.
Parameters:
destRow: int - The start row of the dest range.
destColumn: int - The start column of the dest range.

copyData

 copyData(range)
Copies cell data (including formulas) from a source range.
Parameters:
range: Range - Source Range object.

copyValue

 copyValue(range)
Copies cell value from a source range.
Parameters:
range: Range - Source Range object.

copyStyle

 copyStyle(range)
Copies style settings from a source range.
Parameters:
range: Range - Source Range object.

copy

 copy(range, options)
Copying the range with paste special options.
Parameters:
range: Range - The soure range.
options: PasteOptions - The paste special options.

copy

 copy(range)
Copies data (including formulas), formatting, drawing objects etc. from a source range.
Parameters:
range: Range - Source Range object.

getCellOrNull

Cell getCellOrNull(rowOffset, columnOffset)
Gets Cell object or null in this range.
Parameters:
rowOffset: int - Row offset in this range, zero based.
columnOffset: int - Column offset in this range, zero based.
Returns:
Cell object.

getOffset

Range getOffset(rowOffset, columnOffset)
Gets Range range by offset.
Parameters:
rowOffset: int - Row offset in this range, zero based.
columnOffset: int - Column offset in this range, zero based.
Returns:

toString

String toString()
Returns a string represents the current Range object.
Returns:

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.