Cells

Cells class

Encapsulates a collection of cell relevant objects, such as Cell , Row , …etc.

Properties

NameTypeDescription
OdsCellFieldsOdsCellFieldCollectionGets the list of fields of ods.
CountintGets the total count of instantiated Cell objects.
CountLargelongGets the total count of instantiated Cell objects.
RowsRowCollectionGets the collection of Row objects that represents the individual rows in this worksheet.
MergedCellsArrayListGets the collection of merged cells. In this collection, each item is a CellArea structure which represents an area of m
MultiThreadReadingbooleanGets or sets whether the cells data model should support Multi-Thread reading. Default value of this property is false.
MemorySettingintGets or sets the memory usage option for this cells. The value of the property is MemorySetting integer constant.
StyleStyleGets and sets the default style of the worksheet.
IsDefaultColumnHiddenboolean
StandardWidthInchfloatGets or sets the default column width in the worksheet, in unit of inches.
StandardWidthPixelsintGets or sets the default column width in the worksheet, in unit of pixels.
StandardWidthfloatGets or sets the default column width in the worksheet, in unit of characters.
StandardHeightfloatGets or sets the default row height in this worksheet, in unit of points.
StandardHeightPixelsintGets or sets the default row height in this worksheet, in unit of pixels.
StandardHeightInchfloatGets or sets the default row height in this worksheet, in unit of inches.
PreserveStringbooleanGets or sets a value indicating whether all worksheet values are preserved as strings. Default is false.
MinRowintMinimum row index of cell which contains data or style.
MaxRowintMaximum row index of cell which contains data or style. Return -1 if there is no cell which contains data or style in th
MinColumnintMinimum column index of those cells that have been instantiated in the collection(does not include the column where styl
MaxColumnintMaximum column index of those cells that have been instantiated in the collection(does not include the column where styl
MinDataRowintMinimum row index of cell which contains data.
MaxDataRowintMaximum row index of cell which contains data. Return -1 if there is no cell which contains data.
MinDataColumnintMinimum column index of cell which contains data. -1 will be returned if there is no cell which contains data. This prop
MaxDataColumnintMaximum column index of cell which contains data. -1 will be returned if there is no cell which contains data. This prop
IsDefaultRowHeightMatchedbooleanIndicates that row height and default font height matches
IsDefaultRowHiddenbooleanIndicates whether the row is default hidden.
ColumnsColumnCollectionGets the collection of Column objects that represents the individual columns in this worksheet.
RangesRangeCollectionGets the collection of Range objects created at run time.
LastCellCellGets the last cell in this worksheet. Returns null if there is no data in the worksheet.
MaxDisplayRangeRangeGets the max range which includes data, merged cells and shapes. Reutrns null if the worksheet is empty since Aspose.Cel
FirstCellCellGets the first cell in this worksheet. Returns null if there is no data in the worksheet.
Item (int, int)CellGets the Cell element at the specified cell row index and column index.
Item (java.lang.String)CellGets the Cell element at the specified cell name.

Methods

NameDescription
insertRangeInserts a range of cells and shift cells according to the shift option.
deleteRangeDeletes a range of cells and shift cells according to the shift option.
retrieveSubtotalSettingRetrieves subtotals setting of the range.
subtotalCreates subtotals for the range.
removeFormulasRemoves all formula and replaces with the value of the formula.
removeDuplicatesRemoves duplicate rows in the sheet.
convertStringToNumericValueConverts all string data in the worksheet to numeric value if possible.
getDependentsGet all cells which refer to the specific cell.
getDependentsInCalculationGets all cells whose calculated result depends on specific cell.

To use this method, please make sure the workbook has | | getCellsWithPlaceInCellPicture | Gets all cells that contain embedded picture.

If there is no picture which is set as “Place in Cell” in this worksheet, | | getCellStyle | Get the style of given cell. | | getCellDisplayStyle | | | getColumnWidth | Gets the width(in unit of characters) of the specified column in normal view | | getViewColumnWidthPixel | Get the width in different view type. | | setViewColumnWidthPixel | Sets the width of the column in different view.

If the current view type is ViewType.PAGE_LAYOUT_VIEW , the column’s wi | | getLastDataRow | Gets the last row index of cell which contains data in the specified column. | | getFirstDataRow | | | applyColumnStyle | Applies formats for a whole column. | | applyRowStyle | Applies formats for a whole row. | | applyStyle | Applies formats for a whole worksheet. | | copyColumns | Copies data and formats of a whole column. | | copyColumn | Copies data and formats of a whole column. | | copyRow | Copies data and formats of a whole row. | | copyRows | Copies data and formats of some whole rows. | | getGroupedRowOutlineLevel | Gets the outline level (zero-based) of the row.

If the row is not grouped, returns zero. | | getGroupedColumnOutlineLevel | Gets the outline level (zero-based) of the column.

If the column is not grouped, returns zero. | | getMaxGroupedColumnOutlineLevel | Gets the max grouped column outline level (zero-based). | | getMaxGroupedRowOutlineLevel | Gets the max grouped row outline level (zero-based). | | showGroupDetail | Expands the grouped rows/columns. | | hideGroupDetail | Collapses the grouped rows/columns. | | ungroupColumns | Ungroups columns. | | groupColumns | Groups columns. | | ungroupRows | Ungroups rows. | | groupRows | Groups rows. | | deleteColumn | Deletes a column. | | deleteColumns | Deletes several columns. | | isDeletingRangeEnabled | Check whether the range could be deleted. | | deleteRow | Deletes a row. | | deleteRows | Deletes several rows.

If the deleted range contains the top part(not whole) of the table(ListObject), the ranged could | | deleteBlankColumns | Delete all blank columns which do not contain any data. | | isBlankColumn | Checks whether given column is blank(does not contain any data). | | deleteBlankRows | Delete all blank rows which do not contain any data or other object. | | insertColumns | Inserts some columns into the worksheet. | | insertColumn | Inserts a new column into the worksheet. | | insertRows | Inserts multiple rows into the worksheet. | | insertRow | Inserts a new row into the worksheet. | | clearRange | Clears contents and formatting of a range. | | clearContents | Clears contents of a range. | | clearFormats | Clears formatting of a range. | | linkToXmlMap | Link to a xml map. | | find | Finds the cell containing with the input object.

Returns null (Nothing) if no cell is found. | | endCellInRow | Gets the last cell in this row. | | endCellInColumn | | | moveRange | Moves the range. | | insertCutCells | Insert cut range. | | dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. | | iterator | Gets the cells enumerator.

When traversing elements by the returned Enumerator, the cells collection should not be modi | | getRowEnumerator | Gets the rows enumerator.

NOTE: This member is now obsolete. Instead, please use RowCollection.GetEnumerator() method. | | getMergedAreas | Gets all merged cells. | | checkCell | Gets the Cell element or null at the specified cell row index and column index. | | checkRow | Gets the Row element or null at the specified cell row index. | | checkColumn | Gets the Column element or null at the specified column index. | | isRowHidden | Checks whether a row at given index is hidden. | | isColumnHidden | Checks whether a column at given index is hidden. | | addRange | Adds a range object reference to cells | | createRange | Creates a Range object from a range of cells. | | clear | Clears all data of the worksheet. | | importFormulaArray | Imports an array of formula into a worksheet. | | textToColumns | Splits the text in the column to columns. | | importCSV | Import a CSV file to the cells. | | merge | Merges a specified range of cells into a single cell.

Reference the merged cell via the address of the upper-left cell | | unMerge | Unmerges a specified range of merged cells. | | clearMergedCells | Clears all merged ranges. | | hideRow | Hides a row. | | unhideRow | Unhides a row. | | hideRows | Hides multiple rows. | | unhideRows | Unhides the hidden rows. | | setRowHeightPixel | Sets row height in unit of pixels. | | setRowHeightInch | Sets row height in unit of inches. | | setRowHeight | Sets the height of the specified row. | | getRowHeight | Gets row’s height. | | getRowOriginalHeightPoint | Gets original row’s height in unit of point if the row is hidden

NOTE: This member is now obsolete. Instead, please use | | getColumnOriginalWidthPoint | Gets original column’s height in unit of point if the column is hidden

NOTE: This method is now obsolete. Instead, plea | | hideColumn | Hides a column. | | unhideColumn | Unhides a column | | hideColumns | Hide multiple columns. | | unhideColumns | Unhide multiple columns.

Only applies the column width to the hidden columns. | | getViewRowHeight | Gets the height of a specified row. | | getRowHeightInch | Gets the height of a specified row in unit of inches. | | getViewRowHeightInch | Gets the height of a specified row in unit of inches. | | getRowHeightPixel | Gets the height of a specified row in unit of pixel. | | setColumnWidthPixel | Sets column width in unit of pixels in normal view. | | setColumnWidthInch | Sets column width in unit of inches in normal view. | | setColumnWidth | Sets the width of the specified column in normal view.

To hide a column, sets column width to zero. | | getColumnWidthPixel | Gets the width of the specified column in normal view, in units of pixel. | | getColumnWidthInch | Gets the width of the specified column in normal view, in units of inches.

NOTE: This method is now obsolete. Instead, | | importCSVFromBytes | Import a CSV file to the cells. |

Cells.OdsCellFields property

Gets the list of fields of ods.

Type: OdsCellFieldCollection

Cells.Count property

Gets the total count of instantiated Cell objects.

Type: int

Cells.CountLarge property

Gets the total count of instantiated Cell objects.

Type: long

Cells.Rows property

Gets the collection of Row objects that represents the individual rows in this worksheet.

Type: RowCollection

Cells.MergedCells property

Gets the collection of merged cells. In this collection, each item is a CellArea structure which represents an area of merged cells.

Type: ArrayList

Cells.MultiThreadReading property

Gets or sets whether the cells data model should support Multi-Thread reading. Default value of this property is false. If there are multiple threads to read Row/Cell objects in this collection concurrently, this property should be set as true, otherwise unexpected result may be produced. Supporting Multi-Thread reading may degrade the performance for accessing Row/Cell objects from this collection. Please note, some features cannot support Multi-Thread reading, such as formatting values(by Cell.StringValue , Cell.DisplayStringValue , .etc.). So, even with this property being set as true, those APIs still may give unexpected result for Multi-Thread reading.

Type: boolean

Cells.MemorySetting property

Gets or sets the memory usage option for this cells. The value of the property is MemorySetting integer constant.

Type: int

Cells.Style property

Gets and sets the default style of the worksheet.

Type: Style

Cells.IsDefaultColumnHidden property

Type: boolean

Cells.StandardWidthInch property

Gets or sets the default column width in the worksheet, in unit of inches.

Type: float

Cells.StandardWidthPixels property

Gets or sets the default column width in the worksheet, in unit of pixels.

Type: int

Cells.StandardWidth property

Gets or sets the default column width in the worksheet, in unit of characters.

Type: float

Cells.StandardHeight property

Gets or sets the default row height in this worksheet, in unit of points.

Type: float

Cells.StandardHeightPixels property

Gets or sets the default row height in this worksheet, in unit of pixels.

Type: int

Cells.StandardHeightInch property

Gets or sets the default row height in this worksheet, in unit of inches.

Type: float

Cells.PreserveString property

Gets or sets a value indicating whether all worksheet values are preserved as strings. Default is false.

Type: boolean

Cells.MinRow property

Minimum row index of cell which contains data or style.

Type: int

Cells.MaxRow property

Maximum row index of cell which contains data or style. Return -1 if there is no cell which contains data or style in the worksheet.

Type: int

Cells.MinColumn property

Minimum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).

Type: int

Cells.MaxColumn property

Maximum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it). Return -1 if there is no cell.

Type: int

Cells.MinDataRow property

Minimum row index of cell which contains data.

Type: int

Cells.MaxDataRow property

Maximum row index of cell which contains data. Return -1 if there is no cell which contains data.

Type: int

Cells.MinDataColumn property

Minimum column index of cell which contains data. -1 will be returned if there is no cell which contains data. This property needs to iterate and check all cells in a worksheet, so it is a time-consumed progress and should not be invoked repeatedly.

Type: int

Cells.MaxDataColumn property

Maximum column index of cell which contains data. -1 will be returned if there is no cell which contains data. This property needs to iterate and check all cells in a worksheet, so it is a time-consumed progress and should not be invoked repeatedly.

Type: int

Cells.IsDefaultRowHeightMatched property

Indicates that row height and default font height matches

Type: boolean

Cells.IsDefaultRowHidden property

Indicates whether the row is default hidden.

Type: boolean

Cells.Columns property

Gets the collection of Column objects that represents the individual columns in this worksheet.

Type: ColumnCollection

Cells.Ranges property

Gets the collection of Range objects created at run time.

Type: RangeCollection

Cells.LastCell property

Gets the last cell in this worksheet. Returns null if there is no data in the worksheet.

Type: Cell

Cells.MaxDisplayRange property

Gets the max range which includes data, merged cells and shapes. Reutrns null if the worksheet is empty since Aspose.Cells 21.5.2.

Type: Range

Cells.FirstCell property

Gets the first cell in this worksheet. Returns null if there is no data in the worksheet.

Type: Cell

Cells.Item (int, int) property

Gets the Cell element at the specified cell row index and column index.

Type: Cell

Cells.Item (java.lang.String) property

Gets the Cell element at the specified cell name.

Type: Cell

insertRange(area, shiftNumber, shiftType, updateReference) (1 of 3)

Inserts a range of cells and shift cells according to the shift option.

ParameterTypeDescription
areaCellAreaShift area.
shiftNumberintNumber of rows or columns to be inserted.
shiftTypeintA ShiftType value. Shift cells option.
updateReferencebooleanIndicates whether update references in other worksheets.

insertRange(area, shiftType) (2 of 3)

Inserts a range of cells and shift cells according to the shift option.

ParameterTypeDescription
areaCellAreaShift area.
shiftTypeintA ShiftType value. Shift cells option.

insertRange(area, shiftNumber, shiftType) (3 of 3)

Inserts a range of cells and shift cells according to the shift option.

ParameterTypeDescription
areaCellAreaShift area.
shiftNumberintNumber of rows or columns to be inserted.
shiftTypeintA ShiftType value. Shift cells option.

deleteRange(startRow, startColumn, endRow, endColumn, shiftType)

Deletes a range of cells and shift cells according to the shift option.

ParameterTypeDescription
startRowintStart row index.
startColumnintStart column index.
endRowintEnd row index.
endColumnintEnd column index.
shiftTypeintA ShiftType value. Shift cells option.

retrieveSubtotalSetting(ca)

Retrieves subtotals setting of the range.

ParameterTypeDescription
caCellAreaThe range

subtotal(ca, groupBy, function, totalList) (1 of 2)

Creates subtotals for the range.

ParameterTypeDescription
caCellAreaThe range
groupByintThe field to group by, as a zero-based integer offset
functionintA ConsolidationFunction value. The subtotal function.
totalListNumber ArrayAn array of zero-based field offsets, indicating the fields to which the subtotals are added.

subtotal(ca, groupBy, function, totalList, replace, pageBreaks, summaryBelowData) (2 of 2)

Creates subtotals for the range.

ParameterTypeDescription
caCellAreaThe range
groupByintThe field to group by, as a zero-based integer offset
functionintA ConsolidationFunction value. The subtotal function.
totalListNumber ArrayAn array of zero-based field offsets, indicating the fields to which the subtotals are added.
replacebooleanIndicates whether replace the current subtotals
pageBreaksbooleanIndicates whether add page break between groups
summaryBelowDatabooleanIndicates whether add summary below data.

removeFormulas()

Removes all formula and replaces with the value of the formula.

removeDuplicates() (1 of 3)

Removes duplicate rows in the sheet.


removeDuplicates(startRow, startColumn, endRow, endColumn) (2 of 3)

Removes duplicate values in the range.

ParameterTypeDescription
startRowintThe start row.
startColumnintThe start column
endRowintThe end row index.
endColumnintThe end column index.

removeDuplicates(startRow, startColumn, endRow, endColumn, hasHeaders, columnOffsets) (3 of 3)

Removes duplicate data of the range.

ParameterTypeDescription
startRowintThe start row.
startColumnintThe start column
endRowintThe end row index.
endColumnintThe end column index.
hasHeadersbooleanIndicates whether the range contains headers.
columnOffsetsNumber ArrayThe column offsets.

convertStringToNumericValue()

Converts all string data in the worksheet to numeric value if possible.

getDependents(isAll, row, column)

Get all cells which refer to the specific cell.

ParameterTypeDescription
isAllbooleanIndicates whether check other worksheets
rowintThe row index.
columnintThe column index.

getDependentsInCalculation(row, column, recursive)

Gets all cells whose calculated result depends on specific cell.

To use this method, please make sure the workbook has been set with true value for FormulaSettings.EnableCalculationChain and has been fully calculated with this setting. If there is no formula reference to this cell, null will be returned. For more details and example, please see Cell.getDependentsInCalculation(boolean)

ParameterTypeDescription
rowintRow index of the specific cell
columnintColumn index of the specific cell.
recursivebooleanWhether returns those dependents which do not reference to the specific cell directly but reference to other leafs of that cell.

Returns: Enumerator to enumerate all dependents(Cell objects)

getCellsWithPlaceInCellPicture()

Gets all cells that contain embedded picture.

If there is no picture which is set as “Place in Cell” in this worksheet, null will be returned. />

Returns: Enumerator to enumerate all Cell objects that contain embedded picture

getCellStyle(row, column)

Get the style of given cell.

ParameterTypeDescription
rowintrow index
columnintcolumn

Returns: the style of given cell.

getCellDisplayStyle(row, column) (1 of 2)


getCellDisplayStyle(row, column, adjacentBorders) (2 of 2)

getColumnWidth(column) (1 of 2)

Gets the width(in unit of characters) of the specified column in normal view

ParameterTypeDescription
columnintColumn index

Returns: Width of column. For spreadsheet, column width is measured as the number of characters of the maximum digit width of the numbers 0~9 as rendered in the normal style’s font.


getColumnWidth(column, isOriginal, unitType) (2 of 2)

Gets the column width.

ParameterTypeDescription
columnintThe column index.
isOriginalbooleanIndicates whether getting original width.
unitTypeintA CellsUnitType value.

getViewColumnWidthPixel(column)

Get the width in different view type.

ParameterTypeDescription
columnintThe column index.

Returns: the column width in unit of pixels

setViewColumnWidthPixel(column, pixels)

Sets the width of the column in different view.

If the current view type is ViewType.PAGE_LAYOUT_VIEW , the column’s width is same as printed width.

ParameterTypeDescription
columnintThe column index.
pixelsintThe width in unit of pixels.

getLastDataRow(column)

Gets the last row index of cell which contains data in the specified column.

ParameterTypeDescription
columnintColumn index.

Returns: last row index.

getFirstDataRow(column)

applyColumnStyle(column, style, flag)

Applies formats for a whole column.

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

applyRowStyle(row, style, flag)

Applies formats for a whole row.

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

applyStyle(style, flag)

Applies formats for a whole worksheet.

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

copyColumns(sourceCells, sourceColumnIndex, destinationColumnIndex, columnNumber, pasteOptions) (1 of 3)

Copies data and formats of a whole column.

ParameterTypeDescription
sourceCells0Source Cells object contains data and formats to copy.
sourceColumnIndexintSource column index.
destinationColumnIndexintDestination column index.
columnNumberintThe copied column number.
pasteOptionsPasteOptionsthe options of pasting.

copyColumns(sourceCells, sourceColumnIndex, destinationColumnIndex, columnNumber) (2 of 3)

Copies data and formats of a whole column.

ParameterTypeDescription
sourceCells0Source Cells object contains data and formats to copy.
sourceColumnIndexintSource column index.
destinationColumnIndexintDestination column index.
columnNumberintThe copied column number.

copyColumns(sourceCells, sourceColumnIndex, sourceTotalColumns, destinationColumnIndex, destinationTotalColumns) (3 of 3)

Copies data and formats of the whole columns.

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceColumnIndexintSource column index.
sourceTotalColumnsintThe number of the source columns.
destinationColumnIndexintDestination column index.
destinationTotalColumnsintThe number of the destination columns.

copyColumn(sourceCells, sourceColumnIndex, destinationColumnIndex)

Copies data and formats of a whole column.

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceColumnIndexintSource column index.
destinationColumnIndexintDestination column index.

copyRow(sourceCells, sourceRowIndex, destinationRowIndex)

Copies data and formats of a whole row.

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceRowIndexintSource row index.
destinationRowIndexintDestination row index.

copyRows(sourceCells, sourceRowIndex, destinationRowIndex, rowNumber) (1 of 3)

Copies data and formats of some whole rows.

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceRowIndexintSource row index.
destinationRowIndexintDestination row index.
rowNumberintThe copied row number.

copyRows(sourceCells, sourceRowIndex, destinationRowIndex, rowNumber, copyOptions) (2 of 3)

Copies data and formats of some whole rows.

ParameterTypeDescription
sourceCells0Source Cells object contains data and formats to copy.
sourceRowIndexintSource row index.
destinationRowIndexintDestination row index.
rowNumberintThe copied row number.
copyOptionsCopyOptionsThe copy options.

copyRows(sourceCells0, sourceRowIndex, destinationRowIndex, rowNumber, copyOptions, pasteOptions) (3 of 3)

Copies data and formats of some whole rows.

ParameterTypeDescription
sourceCells0CellsSource Cells object contains data and formats to copy.
sourceRowIndexintSource row index.
destinationRowIndexintDestination row index.
rowNumberintThe copied row number.
copyOptionsCopyOptionsThe copy options.
pasteOptionsPasteOptionsthe options of pasting.

getGroupedRowOutlineLevel(rowIndex)

Gets the outline level (zero-based) of the row.

If the row is not grouped, returns zero.

ParameterTypeDescription
rowIndexintThe row index.

Returns: The outline level (zero-based) of the row.

getGroupedColumnOutlineLevel(columnIndex)

Gets the outline level (zero-based) of the column.

If the column is not grouped, returns zero.

ParameterTypeDescription
columnIndexintThe column index

Returns: The outline level of the column

getMaxGroupedColumnOutlineLevel()

Gets the max grouped column outline level (zero-based).

Returns: The max grouped column outline level (zero-based)

getMaxGroupedRowOutlineLevel()

Gets the max grouped row outline level (zero-based).

Returns: The max grouped row outline level (zero-based)

showGroupDetail(isVertical, index)

Expands the grouped rows/columns.

ParameterTypeDescription
isVerticalbooleanTrue, expands the grouped rows.
indexintThe row/column index

hideGroupDetail(isVertical, index)

Collapses the grouped rows/columns.

ParameterTypeDescription
isVerticalbooleanTrue, collapse the grouped rows.
indexintThe row/column index

ungroupColumns(firstIndex, lastIndex)

Ungroups columns.

ParameterTypeDescription
firstIndexintThe first column index to be ungrouped.
lastIndexintThe last column index to be ungrouped.

groupColumns(firstIndex, lastIndex) (1 of 2)

Groups columns.

ParameterTypeDescription
firstIndexintThe first column index to be grouped.
lastIndexintThe last column index to be grouped.

groupColumns(firstIndex, lastIndex, isHidden) (2 of 2)

Groups columns.

ParameterTypeDescription
firstIndexintThe first column index to be grouped.
lastIndexintThe last column index to be grouped.
isHiddenbooleanSpecifies if the grouped columns are hidden.

ungroupRows(firstIndex, lastIndex, isAll) (1 of 2)

Ungroups rows.

ParameterTypeDescription
firstIndexintThe first row index to be ungrouped.
lastIndexintThe last row index to be ungrouped.
isAllbooleanTrue, removes all grouped info.Otherwise, remove the outer group info.

ungroupRows(firstIndex, lastIndex) (2 of 2)

Ungroups rows.

Only removes outer group info.

ParameterTypeDescription
firstIndexintThe first row index to be ungrouped.
lastIndexintThe last row index to be ungrouped.

groupRows(firstIndex, lastIndex, isHidden) (1 of 2)

Groups rows.

ParameterTypeDescription
firstIndexintThe first row index to be grouped.
lastIndexintThe last row index to be grouped.
isHiddenbooleanSpecifies if the grouped rows are hidden.

groupRows(firstIndex, lastIndex) (2 of 2)

Groups rows.

ParameterTypeDescription
firstIndexintThe first row index to be grouped.
lastIndexintThe last row index to be grouped.

deleteColumn(columnIndex, updateReference) (1 of 2)

Deletes a column.

ParameterTypeDescription
columnIndexintIndex of the column to be deleted.
updateReferencebooleanIndicates whether update references in other worksheets.

deleteColumn(columnIndex) (2 of 2)

Deletes a column.

ParameterTypeDescription
columnIndexintIndex of the column to be deleted.

deleteColumns(columnIndex, totalColumns, updateReference) (1 of 2)

Deletes several columns.

ParameterTypeDescription
columnIndexintIndex of the first column to be deleted.
totalColumnsintCount of columns to be deleted.
updateReferencebooleanIndicates whether update references in other worksheets.

deleteColumns(columnIndex, totalColumns, options) (2 of 2)

isDeletingRangeEnabled(startRow, startColumn, totalRows, totalColumns)

Check whether the range could be deleted.

ParameterTypeDescription
startRowintThe start row index of the range.
startColumnintThe start column index of the range.
totalRowsintThe number of the rows in the range.
totalColumnsintThe number of the columns in the range.

deleteRow(rowIndex) (1 of 2)

Deletes a row.

ParameterTypeDescription
rowIndexintIndex of the row to be deleted.

deleteRow(rowIndex, updateReference) (2 of 2)

Deletes a row.

ParameterTypeDescription
rowIndexintIndex of the row to be deleted.
updateReferencebooleanIndicates whether update references in other worksheets.

deleteRows(rowIndex, totalRows) (1 of 3)

Deletes several rows.

If the deleted range contains the top part(not whole) of the table(ListObject), the ranged could not be deleted and nothing will be done. It works in the same way with MS Excel.

ParameterTypeDescription
rowIndexintThe first row index to be deleted.
totalRowsintCount of rows to be deleted.

deleteRows(rowIndex, totalRows, updateReference) (2 of 3)

Deletes multiple rows in the worksheet.

ParameterTypeDescription
rowIndexintIndex of the first row to be deleted.
totalRowsintCount of rows to be deleted.
updateReferencebooleanIndicates whether update references in other worksheets.

deleteRows(rowIndex, totalRows, options) (3 of 3)

deleteBlankColumns() (1 of 2)

Delete all blank columns which do not contain any data.


deleteBlankColumns(options) (2 of 2)

Delete all blank columns which do not contain any data.

ParameterTypeDescription
optionsDeleteOptionsThe options of deleting range.

isBlankColumn(columnIndex)

Checks whether given column is blank(does not contain any data).

ParameterTypeDescription
columnIndexintthe column index

Returns: true if given column does not contain any data

deleteBlankRows() (1 of 2)

Delete all blank rows which do not contain any data or other object.


deleteBlankRows(options) (2 of 2)

Delete all blank rows which do not contain any data or other object.

For blank rows that will be deleted, it is not only required that Row.IsBlank should be true, but also there should be no visible comment defined for any cell in those rows, and no pivot table whose range intersects with them.

ParameterTypeDescription
optionsDeleteOptionsThe options of deleting range.

insertColumns(columnIndex, totalColumns) (1 of 3)

Inserts some columns into the worksheet.

ParameterTypeDescription
columnIndexintColumn index.
totalColumnsintThe number of columns.

insertColumns(columnIndex, totalColumns, updateReference) (2 of 3)

Inserts some columns into the worksheet.

ParameterTypeDescription
columnIndexintColumn index.
totalColumnsintThe number of columns.
updateReferencebooleanIndicates if references in other worksheets will be updated.

insertColumns(columnIndex, totalColumns, options) (3 of 3)

insertColumn(columnIndex, updateReference) (1 of 2)

Inserts a new column into the worksheet.

ParameterTypeDescription
columnIndexintColumn index.
updateReferencebooleanIndicates if references in other worksheets will be updated.

insertColumn(columnIndex) (2 of 2)

Inserts a new column into the worksheet.

ParameterTypeDescription
columnIndexintColumn index.

insertRows(rowIndex, totalRows, updateReference) (1 of 3)

Inserts multiple rows into the worksheet.

ParameterTypeDescription
rowIndexintRow index.
totalRowsintNumber of rows to be inserted.
updateReferencebooleanIndicates if references in other worksheets will be updated.

insertRows(rowIndex, totalRows, options) (2 of 3)

Inserts multiple rows into the worksheet.

ParameterTypeDescription
rowIndexintRow index.
totalRowsintNumber of rows to be inserted.
optionsInsertOptionsIndicates if references in other worksheets will be updated.

insertRows(rowIndex, totalRows) (3 of 3)

Inserts multiple rows into the worksheet.

ParameterTypeDescription
rowIndexintRow index.
totalRowsintNumber of rows to be inserted.

insertRow(rowIndex)

Inserts a new row into the worksheet.

ParameterTypeDescription
rowIndexintRow index.

clearRange(range) (1 of 2)

Clears contents and formatting of a range.

ParameterTypeDescription
rangeCellAreaRange to be cleared.

clearRange(startRow, startColumn, endRow, endColumn) (2 of 2)

Clears contents and formatting of a range.

ParameterTypeDescription
startRowintStart row index.
startColumnintStart column index.
endRowintEnd row index.
endColumnintEnd column index.

clearContents(range) (1 of 2)

Clears contents of a range.

ParameterTypeDescription
rangeCellAreaRange to be cleared.

clearContents(startRow, startColumn, endRow, endColumn) (2 of 2)

Clears contents of a range.

ParameterTypeDescription
startRowintStart row index.
startColumnintStart column index.
endRowintEnd row index.
endColumnintEnd column index.

clearFormats(range) (1 of 2)

Clears formatting of a range.

ParameterTypeDescription
rangeCellAreaRange to be cleared.

clearFormats(startRow, startColumn, endRow, endColumn) (2 of 2)

Clears formatting of a range.

ParameterTypeDescription
startRowintStart row index.
startColumnintStart column index.
endRowintEnd row index.
endColumnintEnd column index.

linkToXmlMap(mapName, row, column, path)

Link to a xml map.

ParameterTypeDescription
mapNameStringname of xml map
rowintrow of the destination cell
columnintcolumn of the destination cell
pathStringpath of xml element in xml map

find(what, previousCell) (1 of 2)

Finds the cell containing with the input object.

Returns null (Nothing) if no cell is found.

ParameterTypeDescription
whatObjectThe object to search for. The type should be int,double,DateTime,string,bool.
previousCellCellPrevious cell with the same object. This parameter can be set to null if searching from the start.

Returns: Cell object.


find(what, previousCell, findOptions) (2 of 2)

Finds the cell containing with the input object.

Returns null (Nothing) if no cell is found.

ParameterTypeDescription
whatObjectThe object to search for. The type should be int,double,DateTime,string,bool.
previousCellCellPrevious cell with the same object. This parameter can be set to null if searching from the start.
findOptionsFindOptionsFind options

Returns: Cell object.

endCellInRow(rowIndex) (1 of 2)

Gets the last cell in this row.

ParameterTypeDescription
rowIndexintRow index.

Returns: Cell object.


endCellInRow(startRow, endRow, startColumn, endColumn) (2 of 2)

Gets the last cell with maximum row index in this range.

ParameterTypeDescription
startRowintStart row index.
endRowintEnd row index.
startColumnintStart column index.
endColumnintEnd column index.

Returns: Cell object.

endCellInColumn(columnIndex) (1 of 2)


endCellInColumn(startRow, endRow, startColumn, endColumn) (2 of 2)

moveRange(sourceArea, destRow, destColumn)

Moves the range.

ParameterTypeDescription
sourceAreaCellAreaThe range which should be moved.
destRowintThe dest row.
destColumnintThe dest column.

insertCutCells(cutRange, row, column, shiftType)

Insert cut range.

ParameterTypeDescription
cutRangeRangeThe cut range.
rowintThe row.
columnintThe column.
shiftTypeintA ShiftType value. The shift type .

dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

iterator()

Gets the cells enumerator.

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

getRowEnumerator()

Gets the rows enumerator.

NOTE: This member is now obsolete. Instead, please use RowCollection.GetEnumerator() method. This method will be removed 12 months later since May 2023. Aspose apologizes for any inconvenience you may have experienced.

Returns: The rows enumerator.

See Also:

  • RowCollection.iterator()

getMergedAreas()

Gets all merged cells.

checkCell(row, column)

Gets the Cell element or null at the specified cell row index and column index.

ParameterTypeDescription
rowintRow index
columnintColumn index

Returns: Return Cell object if a Cell object exists. Return null if the cell does not exist.

checkRow(row)

Gets the Row element or null at the specified cell row index.

ParameterTypeDescription
rowintRow index

Returns: Returns Row object If the row object does exist, otherwise returns null.

checkColumn(columnIndex)

Gets the Column element or null at the specified column index.

ParameterTypeDescription
columnIndexintThe column index.

Returns: The Column object.

isRowHidden(rowIndex)

Checks whether a row at given index is hidden.

ParameterTypeDescription
rowIndexintrow index

Returns: true if the row is hidden

isColumnHidden(columnIndex)

Checks whether a column at given index is hidden.

ParameterTypeDescription
columnIndexintcolumn index

Returns: true if the column is hidden.

addRange(rangeObject)

Adds a range object reference to cells

ParameterTypeDescription
rangeObjectRangeThe range object will be contained in the cells

createRange(upperLeftCell, lowerRightCell) (1 of 4)

Creates a Range object from a range of cells.

ParameterTypeDescription
upperLeftCellStringUpper left cell name.
lowerRightCellStringLower right cell name.

Returns: A Range object


createRange(firstRow, firstColumn, totalRows, totalColumns) (2 of 4)

Creates a Range object from a range of cells.

ParameterTypeDescription
firstRowintFirst row of this range
firstColumnintFirst column of this range
totalRowsintNumber of rows
totalColumnsintNumber of columns

Returns: A Range object


createRange(address) (3 of 4)

Creates a Range object from an address of the range.

ParameterTypeDescription
addressStringThe address of the range.

Returns: A Range object


createRange(firstIndex, number, isVertical) (4 of 4)

Creates a Range object from rows of cells or columns of cells.

ParameterTypeDescription
firstIndexintFirst row index or first column index, zero based.
numberintTotal number of rows or columns, one based.
isVerticalbooleanTrue - Range created from columns of cells. False - Range created from rows of cells.

Returns: A Range object.

clear()

Clears all data of the worksheet.

importFormulaArray(stringArray, firstRow, firstColumn, isVertical)

Imports an array of formula into a worksheet.

ParameterTypeDescription
stringArrayString[]Formula array.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.
isVerticalbooleanSpecifies to import data vertically or horizontally.

textToColumns(row, column, totalRows, options)

Splits the text in the column to columns.

ParameterTypeDescription
rowintThe row index.
columnintThe column index.
totalRowsintThe number of rows.
optionsTxtLoadOptionsThe split options.

importCSV(fileName, splitter, convertNumericData, firstRow, firstColumn) (1 of 2)

Import a CSV file to the cells.

ParameterTypeDescription
fileNameStringThe CSV file name.
splitterStringThe splitter
convertNumericDatabooleanWhether the string in text file is converted to numeric data.
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.

importCSV(fileName, options, firstRow, firstColumn) (2 of 2)

Import a CSV file to the cells.

ParameterTypeDescription
fileNameStringThe CSV file name.
optionsTxtLoadOptionsThe load options for reading text file
firstRowintThe row number of the first cell to import in.
firstColumnintThe column number of the first cell to import in.

merge(firstRow, firstColumn, totalRows, totalColumns) (1 of 3)

Merges a specified range of cells into a single cell.

Reference the merged cell via the address of the upper-left cell in the range.

ParameterTypeDescription
firstRowintFirst row of this range(zero based)
firstColumnintFirst column of this range(zero based)
totalRowsintNumber of rows(one based)
totalColumnsintNumber of columns(one based)

merge(firstRow, firstColumn, totalRows, totalColumns, mergeConflict) (2 of 3)

Merges a specified range of cells into a single cell.

Reference the merged cell via the address of the upper-left cell in the range. If mergeConflict is true and the merged range conflicts with other merged cells, other merged cells will be automatically removed.

ParameterTypeDescription
firstRowintFirst row of this range(zero based)
firstColumnintFirst column of this range(zero based)
totalRowsintNumber of rows(one based)
totalColumnsintNumber of columns(one based)
mergeConflictbooleanMerge conflict merged ranges.

merge(firstRow, firstColumn, totalRows, totalColumns, checkConflict, mergeConflict) (3 of 3)

Merges a specified range of cells into a single cell.

Reference the merged cell via the address of the upper-left cell in the range. If mergeConflict is true and the merged range conflicts with other merged cells, other merged cells will be automatically removed.

ParameterTypeDescription
firstRowintFirst row of this range(zero based)
firstColumnintFirst column of this range(zero based)
totalRowsintNumber of rows(one based)
totalColumnsintNumber of columns(one based)
checkConflictbooleanIndicates whether check the merged cells intersects other merged cells
mergeConflictbooleanMerge conflict merged ranges.

unMerge(firstRow, firstColumn, totalRows, totalColumns)

Unmerges a specified range of merged cells.

ParameterTypeDescription
firstRowintFirst row of this range(zero based)
firstColumnintFirst column of this range(zero based)
totalRowsintNumber of rows(one based)
totalColumnsintNumber of columns(one based)

clearMergedCells()

Clears all merged ranges.

hideRow(row)

Hides a row.

ParameterTypeDescription
rowintRow index.

unhideRow(row, height)

Unhides a row.

ParameterTypeDescription
rowintRow index.
heightfloatRow height. The row’s height will be changed only when the row is hidden and given height value is positive.

hideRows(row, totalRows)

Hides multiple rows.

ParameterTypeDescription
rowintThe row index.
totalRowsintThe row number.

unhideRows(row, totalRows, height)

Unhides the hidden rows.

ParameterTypeDescription
rowintThe row index.
totalRowsintThe row number.
heightfloatRow height. The row’s height will be changed only when the row is hidden and given height value is positive.

setRowHeightPixel(row, pixels)

Sets row height in unit of pixels.

ParameterTypeDescription
rowintRow index.
pixelsintNumber of pixels.

setRowHeightInch(row, inches)

Sets row height in unit of inches.

ParameterTypeDescription
rowintRow index.
inchesfloatNumber of inches. It should be between 0 and 409.5/72.

setRowHeight(row, height)

Sets the height of the specified row.

ParameterTypeDescription
rowintRow index.
heightfloatHeight of row.In unit of point It should be between 0 and 409.5.

getRowHeight(row, isOriginal, unitType) (1 of 2)

Gets row’s height.

ParameterTypeDescription
rowintThe row index.
isOriginalbooleanWhether returns the original row height or 0 for hidden row.
unitTypeintA CellsUnitType value. Unit type of the returned height value

Returns: Row’s height


getRowHeight(row) (2 of 2)

Gets the height of a specified row, in unit of points.

ParameterTypeDescription
rowintRow index

Returns: Height of row

getRowOriginalHeightPoint(row)

Gets original row’s height in unit of point if the row is hidden

NOTE: This member is now obsolete. Instead, please use Cells.GetRowHeight(int,bool,CellsUnitType) method. This method will be removed 12 months later since April 2024. Aspose apologizes for any inconvenience you may have experienced.

ParameterTypeDescription
rowintThe row index.

getColumnOriginalWidthPoint(column)

Gets original column’s height in unit of point if the column is hidden

NOTE: This method is now obsolete. Instead, please use Cells.GetColumnWidth(int ,bool , CellsUnitType ) method. This method will be removed 12 months later since April 2024. Aspose apologizes for any inconvenience you may have experienced.

ParameterTypeDescription
columnintThe row index.

hideColumn(column)

Hides a column.

ParameterTypeDescription
columnintColumn index.

unhideColumn(column, width)

Unhides a column

ParameterTypeDescription
columnintColumn index.
widthfloatColumn width.

hideColumns(column, totalColumns)

Hide multiple columns.

ParameterTypeDescription
columnintColumn index.
totalColumnsintColumn number.

unhideColumns(column, totalColumns, width)

Unhide multiple columns.

Only applies the column width to the hidden columns.

ParameterTypeDescription
columnintColumn index.
totalColumnsintColumn number
widthfloatColumn width.

getViewRowHeight(row)

Gets the height of a specified row.

ParameterTypeDescription
rowintRow index.

Returns: Height of row.

getRowHeightInch(row)

Gets the height of a specified row in unit of inches.

ParameterTypeDescription
rowintRow index

Returns: Height of row

getViewRowHeightInch(row)

Gets the height of a specified row in unit of inches.

ParameterTypeDescription
rowintRow index

Returns: Height of row

getRowHeightPixel(row)

Gets the height of a specified row in unit of pixel.

ParameterTypeDescription
rowintRow index

Returns: Height of row

setColumnWidthPixel(column, pixels)

Sets column width in unit of pixels in normal view.

ParameterTypeDescription
columnintColumn index.
pixelsintNumber of pixels.

setColumnWidthInch(column, inches)

Sets column width in unit of inches in normal view.

ParameterTypeDescription
columnintColumn index.
inchesfloatNumber of inches.

setColumnWidth(column, width)

Sets the width of the specified column in normal view.

To hide a column, sets column width to zero.

ParameterTypeDescription
columnintColumn index.
widthfloatWidth of column.Column width must be between 0 and 255.

getColumnWidthPixel(column) (1 of 2)

Gets the width of the specified column in normal view, in units of pixel.

ParameterTypeDescription
columnintColumn index

Returns: Width of column in normal view.


getColumnWidthPixel(column, original) (2 of 2)

Gets the width of the specified column in normal view, in units of pixel.

NOTE: This method is now obsolete. Instead, please use Cells.GetColumnWidth(int ,bool , CellsUnitType ) method. This method will be removed 12 months later since April 2024. Aspose apologizes for any inconvenience you may have experienced.

ParameterTypeDescription
columnintColumn index
originalbooleanIndicates whether returning original width even when the column is hidden

Returns: Width of column in normal view.

getColumnWidthInch(column)

Gets the width of the specified column in normal view, in units of inches.

NOTE: This method is now obsolete. Instead, please use Cells.GetColumnWidth(int ,bool , CellsUnitType ) method. This method will be removed 12 months later since April 2024. Aspose apologizes for any inconvenience you may have experienced.

ParameterTypeDescription
columnintColumn index

Returns: Width of column

importCSVFromBytes(byte_array, firstRow, firstColumn, spliter, convertNumericData) (1 of 2)

Import a CSV file to the cells.

ParameterTypeDescription
byte_arraybytesThe byte array
firstRowintThe row number of the first cell to import in
firstColumnintThe column number of the first cell to import in
spliterStringThe spliter
convertNumericDatabooleanWhether the string in text file is converted to numeric data

Example:

import jpype
import asposecells
jpype.startJVM()
from asposecells.api import *

wb = Workbook()
cells = wb.getWorksheets().get(0).getCells()
with open('EmployeeList.csv', 'rb') as f:
    cells.importCSVFromBytes(f.read(), 0, 1, spliter=",", convertNumericData=False)
wb.save("wb.xlsx")

jpype.shutdownJVM()

importCSVFromBytes(byte_array, firstRow, firstColumn, options) (2 of 2)

Import a CSV file to the cells.

ParameterTypeDescription
byte_arraybytesThe byte array
firstRowintThe row number of the first cell to import in
firstColumnintThe column number of the first cell to import in
optionsTxtLoadOptionsThe load options for reading text file

Example:

import jpype
import asposecells
jpype.startJVM()
from asposecells.api import *

wb = Workbook()
cells = wb.getWorksheets().get(0).getCells()
loadOptions = TxtLoadOptions()
with open('EmployeeList.csv', 'rb') as f:
    cells.importCSVFromBytes(f.read(), 0, 1, options=loadOptions)
wb.save("wb.xlsx")

jpype.shutdownJVM()