Aspose::Cells::Cells class

Cells class

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

class Cells

Methods

MethodDescription
AddRange(const Range& rangeObject)Adds a range object reference to cells.
ApplyColumnStyle(int32_t column, const Style& style, const StyleFlag& flag)Applies formats for a whole column.
ApplyRowStyle(int32_t row, const Style& style, const StyleFlag& flag)Applies formats for a whole row.
ApplyStyle(const Style& style, const StyleFlag& flag)Applies formats for a whole worksheet.
Cells(Cells_Impl* impl)Constructs from an implementation object.
Cells(const Cells& src)Copy constructor.
CheckCell(int32_t row, int32_t column)Gets the Cell element or null at the specified cell row index and column index.
CheckColumn(int32_t columnIndex)Gets the Column element or null at the specified column index.
CheckRow(int32_t row)Gets the Row element or null at the specified cell row index.
Clear()Clears all data of the worksheet.
ClearContents(const CellArea& range)Clears contents of a range.
ClearContents(int32_t startRow, int32_t startColumn, int32_t endRow, int32_t endColumn)Clears contents of a range.
ClearFormats(const CellArea& range)Clears formatting of a range.
ClearFormats(int32_t startRow, int32_t startColumn, int32_t endRow, int32_t endColumn)Clears formatting of a range.
ClearMergedCells()Clears all merged ranges.
ClearRange(const CellArea& range)Clears contents and formatting of a range.
ClearRange(int32_t startRow, int32_t startColumn, int32_t endRow, int32_t endColumn)Clears contents and formatting of a range.
ConvertStringToNumericValue()Converts all string data in the worksheet to numeric value if possible.
CopyColumn(const Cells& sourceCells, int32_t sourceColumnIndex, int32_t destinationColumnIndex)Copies data and formats of a whole column.
CopyColumns(const Cells& sourceCells0, int32_t sourceColumnIndex, int32_t destinationColumnIndex, int32_t columnNumber, const PasteOptions& pasteOptions)Copies data and formats of a whole column.
CopyColumns(const Cells& sourceCells0, int32_t sourceColumnIndex, int32_t destinationColumnIndex, int32_t columnNumber)Copies data and formats of a whole column.
CopyColumns(const Cells& sourceCells, int32_t sourceColumnIndex, int32_t sourceTotalColumns, int32_t destinationColumnIndex, int32_t destinationTotalColumns)Copies data and formats of the whole columns.
CopyRow(const Cells& sourceCells, int32_t sourceRowIndex, int32_t destinationRowIndex)Copies data and formats of a whole row.
CopyRows(const Cells& sourceCells, int32_t sourceRowIndex, int32_t destinationRowIndex, int32_t rowNumber)Copies data and formats of some whole rows.
CopyRows(const Cells& sourceCells0, int32_t sourceRowIndex, int32_t destinationRowIndex, int32_t rowNumber, const CopyOptions& copyOptions)Copies data and formats of some whole rows.
CopyRows(const Cells& sourceCells0, int32_t sourceRowIndex, int32_t destinationRowIndex, int32_t rowNumber, const CopyOptions& copyOptions, const PasteOptions& pasteOptions)Copies data and formats of some whole rows.
CreateRange(const U16String& upperLeftCell, const U16String& lowerRightCell)Creates a Range object from a range of cells.
CreateRange(const char16_t* upperLeftCell, const char16_t* lowerRightCell)Creates a Range object from a range of cells.
CreateRange(int32_t firstRow, int32_t firstColumn, int32_t totalRows, int32_t totalColumns)Creates a Range object from a range of cells.
CreateRange(const U16String& address)Creates a Range object from an address of the range.
CreateRange(const char16_t* address)Creates a Range object from an address of the range.
CreateRange(int32_t firstIndex, int32_t number, bool isVertical)Creates a Range object from rows of cells or columns of cells.
DeleteBlankColumns()Delete all blank columns which do not contain any data.
DeleteBlankColumns(const DeleteOptions& options)Delete all blank columns which do not contain any data.
DeleteBlankRows()Delete all blank rows which do not contain any data or other object.
DeleteBlankRows(const DeleteOptions& options)Delete all blank rows which do not contain any data or other object.
DeleteColumn(int32_t columnIndex, bool updateReference)Deletes a column.
DeleteColumn(int32_t columnIndex)Deletes a column.
DeleteColumns(int32_t columnIndex, int32_t totalColumns, bool updateReference)Deletes several columns.
DeleteRange(int32_t startRow, int32_t startColumn, int32_t endRow, int32_t endColumn, ShiftType shiftType)Deletes a range of cells and shift cells according to the shift option.
DeleteRow(int32_t rowIndex)Deletes a row.
DeleteRow(int32_t rowIndex, bool updateReference)Deletes a row.
DeleteRows(int32_t rowIndex, int32_t totalRows)Deletes several rows.
DeleteRows(int32_t rowIndex, int32_t totalRows, bool updateReference)Deletes multiple rows in the worksheet.
Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
EndCellInColumn(int16_t columnIndex)Gets the last cell in this column.
EndCellInColumn(int32_t startRow, int32_t endRow, int16_t startColumn, int16_t endColumn)Gets the last cell with maximum column index in this range.
EndCellInRow(int32_t rowIndex)Gets the last cell in this row.
EndCellInRow(int32_t startRow, int32_t endRow, int32_t startColumn, int32_t endColumn)Gets the last cell with maximum row index in this range.
Get(int32_t row, int32_t column)Gets the Cell element at the specified cell row index and column index.
Get(const U16String& cellName)Gets the Cell element at the specified cell name.
Get(const char16_t* cellName)Gets the Cell element at the specified cell name.
GetCell(int32_t row, int32_t column)(Deprecated) Gets the Cell element or null at the specified cell row index and column index.
GetCellStyle(int32_t row, int32_t column)Get the style of given cell.
GetColumnOriginalWidthPoint(int32_t column)(Deprecated) Gets original column’s height in unit of point if the column is hidden.
GetColumns()Gets the collection of Column objects that represents the individual columns in this worksheet.
GetColumnWidth(int32_t column, bool isOriginal, CellsUnitType unitType)Gets the column width.
GetColumnWidth(int32_t column)Gets the width(in unit of characters) of the specified column in normal view.
GetColumnWidthInch(int32_t column)(Deprecated) Gets the width of the specified column in normal view, in units of inches.
GetColumnWidthPixel(int32_t column)Gets the width of the specified column in normal view, in units of pixel.
GetColumnWidthPixel(int32_t column, bool original)(Deprecated) Gets the width of the specified column in normal view, in units of pixel.
GetCount()Gets the total count of instantiated Cell objects.
GetCountLarge()Gets the total count of instantiated Cell objects.
GetDependents(bool isAll, int32_t row, int32_t column)Get all cells which refer to the specific cell.
GetDependentsInCalculation(int32_t row, int32_t column, bool recursive)Gets all cells whose calculated result depends on specific cell.
GetEnumerator()Gets the cells enumerator.
GetFirstCell()Gets the first cell in this worksheet.
GetGroupedColumnOutlineLevel(int32_t columnIndex)Gets the outline level (zero-based) of the column.
GetGroupedRowOutlineLevel(int32_t rowIndex)Gets the outline level (zero-based) of the row.
GetLastCell()Gets the last cell in this worksheet.
GetLastDataRow(int32_t column)Gets the last row index of cell which contains data in the specified column.
GetMaxColumn()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).
GetMaxDataColumn()Maximum column index of cell which contains data.
GetMaxDataRow()Maximum row index of cell which contains data.
GetMaxDisplayRange()Gets the max range which includes data, merged cells and shapes.
GetMaxGroupedColumnOutlineLevel()Gets the max grouped column outline level (zero-based).
GetMaxGroupedRowOutlineLevel()Gets the max grouped row outline level (zero-based).
GetMaxRow()Maximum row index of cell which contains data or style.
GetMemorySetting()Gets or sets the memory usage option for this cells.
GetMergedAreas()Gets all merged cells.
GetMinColumn()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).
GetMinDataColumn()Minimum column index of cell which contains data.
GetMinDataRow()Minimum row index of cell which contains data.
GetMinRow()Minimum row index of cell which contains data or style.
GetMultiThreadReading()Gets or sets whether the cells data model should support Multi-Thread reading. Default value of this property is false.
GetOdsCellFields()Gets the list of fields of ods.
GetPreserveString()Gets or sets a value indicating whether all worksheet values are preserved as strings. Default is false.
GetRanges()Gets the collection of Range objects created at run time.
GetRow(int32_t row)(Deprecated) Gets the Row element at the specified cell row index.
GetRowHeight(int32_t row, bool isOriginal, CellsUnitType unitType)Gets original row’s height.
GetRowHeight(int32_t row)Gets the height of a specified row, in unit of points.
GetRowHeightInch(int32_t row)Gets the height of a specified row in unit of inches.
GetRowHeightPixel(int32_t row)Gets the height of a specified row in unit of pixel.
GetRowOriginalHeightPoint(int32_t row)(Deprecated) Gets original row’s height in unit of point if the row is hidden.
GetRows()Gets the collection of Row objects that represents the individual rows in this worksheet.
GetStandardHeight()Gets or sets the default row height in this worksheet, in unit of points.
GetStandardHeightInch()Gets or sets the default row height in this worksheet, in unit of inches.
GetStandardHeightPixels()Gets or sets the default row height in this worksheet, in unit of pixels.
GetStandardWidth()Gets or sets the default column width in the worksheet, in unit of characters.
GetStandardWidthInch()Gets or sets the default column width in the worksheet, in unit of inches.
GetStandardWidthPixels()Gets or sets the default column width in the worksheet, in unit of pixels.
GetStyle()Gets and sets the default style of the worksheet.
GetViewColumnWidthPixel(int32_t column)Get the width in different view type.
GetViewRowHeight(int32_t row)Gets the height of a specified row.
GroupColumns(int32_t firstIndex, int32_t lastIndex)Groups columns.
GroupColumns(int32_t firstIndex, int32_t lastIndex, bool isHidden)Groups columns.
GroupRows(int32_t firstIndex, int32_t lastIndex, bool isHidden)Groups rows.
GroupRows(int32_t firstIndex, int32_t lastIndex)Groups rows.
HideColumn(int32_t column)Hides a column.
HideColumns(int32_t column, int32_t totalColumns)Hide multiple columns.
HideGroupDetail(bool isVertical, int32_t index)Collapses the grouped rows/columns.
HideRow(int32_t row)Hides a row.
HideRows(int32_t row, int32_t totalRows)Hides multiple rows.
ImportCSV(const U16String& fileName, const U16String& splitter, bool convertNumericData, int32_t firstRow, int32_t firstColumn)Import a CSV file to the cells.
ImportCSV(const char16_t* fileName, const char16_t* splitter, bool convertNumericData, int32_t firstRow, int32_t firstColumn)Import a CSV file to the cells.
ImportCSV(const Vector <uint8_t>& stream, const U16String& splitter, bool convertNumericData, int32_t firstRow, int32_t firstColumn)Import a CSV file to the cells.
ImportCSV(const Vector <uint8_t>& stream, const char16_t* splitter, bool convertNumericData, int32_t firstRow, int32_t firstColumn)Import a CSV file to the cells.
ImportCSV(const U16String& fileName, const TxtLoadOptions& options, int32_t firstRow, int32_t firstColumn)Import a CSV file to the cells.
ImportCSV(const char16_t* fileName, const TxtLoadOptions& options, int32_t firstRow, int32_t firstColumn)Import a CSV file to the cells.
ImportCSV(const Vector <uint8_t>& stream, const TxtLoadOptions& options, int32_t firstRow, int32_t firstColumn)Import a CSV file to the cells.
ImportFormulaArray(const Vector <U16String>& stringArray, int32_t firstRow, int32_t firstColumn, bool isVertical)Imports an array of formula into a worksheet.
InsertColumn(int32_t columnIndex, bool updateReference)Inserts a new column into the worksheet.
InsertColumn(int32_t columnIndex)Inserts a new column into the worksheet.
InsertColumns(int32_t columnIndex, int32_t totalColumns)Inserts some columns into the worksheet.
InsertColumns(int32_t columnIndex, int32_t totalColumns, bool updateReference)Inserts some columns into the worksheet.
InsertCutCells(const Range& cutRange, int32_t row, int32_t column, ShiftType shiftType)Insert cut range.
InsertRange(const CellArea& area, int32_t shiftNumber, ShiftType shiftType, bool updateReference)Inserts a range of cells and shift cells according to the shift option.
InsertRange(const CellArea& area, ShiftType shiftType)Inserts a range of cells and shift cells according to the shift option.
InsertRange(const CellArea& area, int32_t shiftNumber, ShiftType shiftType)Inserts a range of cells and shift cells according to the shift option.
InsertRow(int32_t rowIndex)Inserts a new row into the worksheet.
InsertRows(int32_t rowIndex, int32_t totalRows, bool updateReference)Inserts multiple rows into the worksheet.
InsertRows(int32_t rowIndex, int32_t totalRows, const InsertOptions& options)Inserts multiple rows into the worksheet.
InsertRows(int32_t rowIndex, int32_t totalRows)Inserts multiple rows into the worksheet.
IsBlankColumn(int32_t columnIndex)Checks whether given column is blank(does not contain any data).
IsColumnHidden(int32_t columnIndex)Checks whether a column at given index is hidden.
IsDefaultRowHeightMatched()Indicates that row height and default font height matches.
IsDefaultRowHidden()Indicates whether the row is default hidden.
IsDeletingRangeEnabled(int32_t startRow, int32_t startColumn, int32_t totalRows, int32_t totalColumns)Check whether the range could be deleted.
IsNull() constChecks whether the implementation object is nullptr.
IsRowHidden(int32_t rowIndex)Checks whether a row at given index is hidden.
LinkToXmlMap(const U16String& mapName, int32_t row, int32_t column, const U16String& path)Link to a xml map.
LinkToXmlMap(const char16_t* mapName, int32_t row, int32_t column, const char16_t* path)Link to a xml map.
Merge(int32_t firstRow, int32_t firstColumn, int32_t totalRows, int32_t totalColumns)Merges a specified range of cells into a single cell.
Merge(int32_t firstRow, int32_t firstColumn, int32_t totalRows, int32_t totalColumns, bool mergeConflict)Merges a specified range of cells into a single cell.
Merge(int32_t firstRow, int32_t firstColumn, int32_t totalRows, int32_t totalColumns, bool checkConflict, bool mergeConflict)Merges a specified range of cells into a single cell.
MoveRange(const CellArea& sourceArea, int32_t destRow, int32_t destColumn)Moves the range.
explicit operator bool() constoperator bool()
operator=(const Cells& src)operator=
RemoveDuplicates()Removes duplicate rows in the sheet.
RemoveDuplicates(int32_t startRow, int32_t startColumn, int32_t endRow, int32_t endColumn)Removes duplicate values in the range.
RemoveDuplicates(int32_t startRow, int32_t startColumn, int32_t endRow, int32_t endColumn, bool hasHeaders, const Vector <int32_t>& columnOffsets)Removes duplicate data of the range.
RemoveFormulas()Removes all formula and replaces with the value of the formula.
RetrieveSubtotalSetting(const CellArea& ca)Retrieves subtotals setting of the range.
SetColumnWidth(int32_t column, double width)Sets the width of the specified column in normal view.
SetColumnWidthInch(int32_t column, double inches)Sets column width in unit of inches in normal view.
SetColumnWidthPixel(int32_t column, int32_t pixels)Sets column width in unit of pixels in normal view.
SetIsDefaultRowHeightMatched(bool value)Indicates that row height and default font height matches.
SetIsDefaultRowHidden(bool value)Indicates whether the row is default hidden.
SetMemorySetting(MemorySetting value)Gets or sets the memory usage option for this cells.
SetMultiThreadReading(bool value)Gets or sets whether the cells data model should support Multi-Thread reading. Default value of this property is false.
SetPreserveString(bool value)Gets or sets a value indicating whether all worksheet values are preserved as strings. Default is false.
SetRowHeight(int32_t row, double height)Sets the height of the specified row.
SetRowHeightInch(int32_t row, double inches)Sets row height in unit of inches.
SetRowHeightPixel(int32_t row, int32_t pixels)Sets row height in unit of pixels.
SetStandardHeight(double value)Gets or sets the default row height in this worksheet, in unit of points.
SetStandardHeightInch(double value)Gets or sets the default row height in this worksheet, in unit of inches.
SetStandardHeightPixels(int32_t value)Gets or sets the default row height in this worksheet, in unit of pixels.
SetStandardWidth(double value)Gets or sets the default column width in the worksheet, in unit of characters.
SetStandardWidthInch(double value)Gets or sets the default column width in the worksheet, in unit of inches.
SetStandardWidthPixels(int32_t value)Gets or sets the default column width in the worksheet, in unit of pixels.
SetStyle(const Style& value)Gets and sets the default style of the worksheet.
SetViewColumnWidthPixel(int32_t column, int32_t pixels)Sets the width of the column in different view.
ShowGroupDetail(bool isVertical, int32_t index)Expands the grouped rows/columns.
Subtotal(const CellArea& ca, int32_t groupBy, ConsolidationFunction function, const Vector <int32_t>& totalList)Creates subtotals for the range.
Subtotal(const CellArea& ca, int32_t groupBy, ConsolidationFunction function, const Vector <int32_t>& totalList, bool replace, bool pageBreaks, bool summaryBelowData)Creates subtotals for the range.
TextToColumns(int32_t row, int32_t column, int32_t totalRows, const TxtLoadOptions& options)Splits the text in the column to columns.
UngroupColumns(int32_t firstIndex, int32_t lastIndex)Ungroups columns.
UngroupRows(int32_t firstIndex, int32_t lastIndex, bool isAll)Ungroups rows.
UngroupRows(int32_t firstIndex, int32_t lastIndex)Ungroups rows.
UnhideColumn(int32_t column, double width)Unhides a column.
UnhideColumns(int32_t column, int32_t totalColumns, double width)Unhide multiple columns.
UnhideRow(int32_t row, double height)Unhides a row.
UnhideRows(int32_t row, int32_t totalRows, double height)Unhides the hidden rows.
UnMerge(int32_t firstRow, int32_t firstColumn, int32_t totalRows, int32_t totalColumns)Unmerges a specified range of merged cells.
~Cells()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
Workbook excel;
Cells cells = excel.GetWorksheets().Get(0).GetCells();

//Set default row height
cells.SetStandardHeight(20);
//Set row height
cells.SetRowHeight(2, 20.5);

//Set default colum width
cells.SetStandardWidth(15);
//Set column width
cells.SetColumnWidth(3, 12.57);

//Merge cells
cells.Merge(5, 4, 2, 2);

//Put values to cells
cells.Get(0, 0).PutValue(true);
cells.Get(0, 1).PutValue(1);
cells.Get(0, 2).PutValue(u"abc");
Aspose::Cells::Cleanup();

See Also