Row

Row class

Represents a single row in a worksheet.

Methods

NameDescription
applyStyle(style, flag)Applies formats for a whole row.
copySettings(source, checkStyle)Copy settings of row, such as style, height, visibility, …etc.
equals(obj)Checks whether this object refers to the same row with another.
equals(row)Checks whether this object refers to the same row with another row object.
get(column)Gets the cell.
getCellByIndex(index)Get the cell by specific index in the cells collection of this row. To traverse all cells in sequence without modificati
getCellOrNull(column)Gets the cell or null in the specific index.
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 th
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 denote
isHidden()Indicates whether the row is hidden.
iterator()Gets 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 denote
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 th

applyStyle(style, flag)

Applies formats for a whole row.

ParameterTypeDescription
styleStyleThe style object which will be applied.
flagStyleFlagFlags which indicates applied formatting properties.

copySettings(source, checkStyle)

Copy settings of row, such as style, height, visibility, …etc.

ParameterTypeDescription
sourceRowthe source row whose settings will be copied to this one
checkStylebooleanwhether 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)

Checks whether this object refers to the same row with another.

ParameterTypeDescription
objObjectanother object

Returns: boolean — boolean true if two objects refers to the same row.

equals(row)

Checks whether this object refers to the same row with another row object.

ParameterTypeDescription
rowRowanother row object

Returns: boolean — boolean true if two row objects refers to the same row.

get(column)

Gets the cell.

ParameterTypeDescription
columnNumberThe column index

Returns: Cell — Cell

getCellByIndex(index)

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.

ParameterTypeDescription
indexNumberThe index(position) of the cell in the cells collection of this row.

Returns: Cell — Cell The Cell object at given position.

getCellOrNull(column)

Gets the cell or null in the specific index.

ParameterTypeDescription
columnNumberThe column index

Returns: Cell — 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()

Gets the cells enumerator

Returns: Iterator — 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)

ParameterTypeDescription
styleStylethe style to be used as the default style for cells in this row.