Row
Source: aspose.
Represents a single row in a worksheet.
Methods
Methods
applyStyle(style, flag)
Applies formats for a whole row.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
style |
|
The style object which will be applied. |
|
flag |
|
Flags which indicates applied formatting properties. |
copySettings(source, checkStyle)
Copy settings of row, such as style, height, visibility, ...etc.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
source |
|
the source row whose settings will be copied to this one |
|
checkStyle |
boolean |
|
whether check and gather style. Only takes effect and be needed when two row objects belong to different workbook and the styles of two workbooks are different. |
equals(obj) → boolean
Checks whether this object refers to the same row with another.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
obj |
Object |
|
another object |
- Returns
-
boolean
true if two objects refers to the same row.
equals(row) → boolean
Checks whether this object refers to the same row with another row object.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
row |
|
another row object |
- Returns
-
boolean
true if two row objects refers to the same row.
get(column) → Cell
Gets the cell.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
column |
Number |
|
The column index |
- Returns
getCellByIndex(index) → Cell
Get the cell by specific index in the cells collection of this row. To traverse all cells in sequence without modification, using iterator() will give better performance than using this method to get cell one by one.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
index |
Number |
|
The index(position) of the cell in the cells collection of this row. |
- Returns
-
Cell
The Cell object at given position.
getCellOrNull(column) → Cell
Gets the cell or null in the specific index.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
column |
Number |
|
The column index |
- Returns
-
Cell
Returns the cell object if the cell exists. Or returns null if the cell object does not exist.
getFirstCell()
Gets the first cell object in the row.
getFirstDataCell()
Gets the first non-blank cell in the row.
getGroupLevel()
Gets the group level of the row.
getHeight()
Gets and sets the row height in unit of Points.
getIndex()
Gets the index of this row.
getLastCell()
Gets the last cell object in the row.
getLastDataCell()
Gets the last non-blank cell in the row.
getStyle()
Gets the style of this row. Modifying the returned style object directly takes no effect for this row or any cells in this row. You have to call applyStyle(com.aspose.cells.Style, com.aspose.cells.StyleFlag) or setStyle(com.aspose.cells.Style) method to apply the change to this row. Row's style is the style which will be inherited by cells in this row(those cells that have no custom style settings, such as existing cells that have not been set style explicitly, or those that have not been instantiated)
hasCustomStyle()
Indicates whether this row has custom style settings(different from the default one inherited from workbook).
isBlank()
Indicates whether the row contains any data
isCollapsed()
whether the row is collapsed
isHeightMatched()
Indicates whether the row height matches current default font setting of the workbook. True of this property also denotes the row height is "automatic" without custom height value set by user. When this property is true, if the content in this row changes, generally the row height needs to be re-calculated(such as by Worksheet.autoFitRows()) to get the same result with what is shown in ms excel when you opening the workbook in it.
isHidden()
Indicates whether the row is hidden.
iterator() → Iterator
Gets the cells enumerator
- Returns
-
Iterator
The cells enumerator
setCollapsed()
whether the row is collapsed
setGroupLevel()
Gets the group level of the row.
setHeight()
Gets and sets the row height in unit of Points.
setHeightMatched()
Indicates whether the row height matches current default font setting of the workbook. True of this property also denotes the row height is "automatic" without custom height value set by user. When this property is true, if the content in this row changes, generally the row height needs to be re-calculated(such as by Worksheet.autoFitRows()) to get the same result with what is shown in ms excel when you opening the workbook in it.
setHidden()
Indicates whether the row is hidden.
setStyle(style)
Sets the style of this row. This method only sets the given style as the default style for this row, without changing the style settings for existing cells in this row. To update style settings of existing cells to the specified style at the same time, please use applyStyle(com.aspose.cells.Style, com.aspose.cells.StyleFlag)
Parameter
Name | Type | Optional | Description |
---|---|---|---|
style |
|
the style to be used as the default style for cells in this row. |