Row

Row class

Represents a single row in a worksheet.

Properties

NameTypeDescription
IsBlankbooleanIndicates whether the row contains any data
IsCollapsedbooleanwhether the row is collapsed
HeightfloatGets and sets the row height in unit of Points.
IsHiddenbooleanIndicates whether the row is hidden.
IndexintGets the index of this row.
GroupLevelbyteGets the group level of the row.
IsHeightMatchedbooleanIndicates whether the row height matches current default font setting of the workbook. True of this property also denote
HasCustomStylebooleanIndicates whether this row has custom style settings(different from the default one inherited from workbook).
FirstCellCellGets the first cell object in the row.
FirstDataCellCellGets the first non-blank cell in the row.
LastCellCellGets the last cell object in the row.
LastDataCellCellGets the last non-blank cell in the row.
Item (int)CellGets the cell.

Methods

NameDescription
getCellByIndexGet the cell by specific index in the cells collection of this row.

To traverse all cells in sequence without modificat | | iterator | Gets the cells enumerator | | getCellOrNull | Gets the cell or null in the specific index. | | getStyle | Gets the style of this row.

Modifying the returned style object directly takes no effect for this row or any cells in t | | setStyle | Sets the style of this row.

This method only sets the given style as the default style for this row, without changing t | | copySettings | Copy settings of row, such as style, height, visibility, …etc. | | applyStyle | Applies formats for a whole row. | | equals | Checks whether this object refers to the same row with another. |

Row.IsBlank property

Indicates whether the row contains any data

Type: boolean

Row.IsCollapsed property

whether the row is collapsed

Type: boolean

Row.Height property

Gets and sets the row height in unit of Points.

Type: float

Row.IsHidden property

Indicates whether the row is hidden.

Type: boolean

Row.Index property

Gets the index of this row.

Type: int

Row.GroupLevel property

Gets the group level of the row.

Type: byte

Row.IsHeightMatched property

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.

Type: boolean

Row.HasCustomStyle property

Indicates whether this row has custom style settings(different from the default one inherited from workbook).

Type: boolean

Row.FirstCell property

Gets the first cell object in the row.

Type: Cell

Row.FirstDataCell property

Gets the first non-blank cell in the row.

Type: Cell

Row.LastCell property

Gets the last cell object in the row.

Type: Cell

Row.LastDataCell property

Gets the last non-blank cell in the row.

Type: Cell

Row.Item (int) property

Gets the cell.

Type: 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
indexintThe index(position) of the cell in the cells collection of this row.

Returns: The Cell object at given position.

iterator()

Gets the cells enumerator

Returns: The cells enumerator

getCellOrNull(column)

Gets the cell or null in the specific index.

ParameterTypeDescription
columnintThe column index

Returns: Returns the cell object if the cell exists. Or returns null if the cell object does not exist.

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)

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.

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.

applyStyle(style, flag)

Applies formats for a whole row.

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

equals(obj) (1 of 2)

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

ParameterTypeDescription
objObjectanother object

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


equals(row) (2 of 2)

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

ParameterTypeDescription
rowRowanother row object

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