Aspose::Cells::Tables::ListObject class

ListObject class

Represents a table in a worksheet.

class ListObject

Methods

MethodDescription
ApplyStyleToRange()Apply the table style to the range.
ConvertToRange()Convert the table to range.
ConvertToRange(const TableToRangeOptions& options)Convert the table to range.
Filter()(Deprecated) Filter the table.
GetAlternativeDescription()Gets and sets the alternative description.
GetAlternativeText()Gets and sets the alternative text.
GetAutoFilter()Gets auto filter of this table.
GetComment()Gets and sets the comment of the table.
GetDataRange()Gets the data range of the Table.
GetDataSourceType()Gets the data source type of the table.
GetDisplayName()Gets and sets the display name of the table.
GetEndColumn()Gets the end column of the range.
GetEndRow()Gets the end row of the range.
GetHasAutoFilter()Indicates whether auto filter is applied to this table.
GetListColumns()Gets the ListColumn list of this table.
GetQueryTable()Gets the linked QueryTable.
GetShowHeaderRow()Gets and sets whether this Table shows header row.
GetShowTableStyleColumnStripes()Indicates whether column stripe formatting is applied to.
GetShowTableStyleFirstColumn()Indicates whether the first column in the table is the style applied to.
GetShowTableStyleLastColumn()Indicates whether the last column in the table is the style applied to.
GetShowTableStyleRowStripes()Indicates whether row stripe formatting is applied to.
GetShowTotals()Gets and sets whether this TAble shows total row.
GetStartColumn()Gets the start column of the range.
GetStartRow()Gets the start row of the range.
GetTableStyleName()Gets and sets the table style name.
GetTableStyleType()Gets and the built-in table style.
GetXmlMap()Gets an XmlMap used for this list.
IsNull() constChecks whether the implementation object is nullptr.
ListObject(ListObject_Impl* impl)Constructs from an implementation object.
ListObject(const ListObject& src)Copy constructor.
explicit operator bool() constoperator bool()
operator=(const ListObject& src)operator=
PutCellFormula(int32_t rowOffset, int32_t columnOffset, const U16String& formula)Put the formula to the cell in the table.
PutCellFormula(int32_t rowOffset, int32_t columnOffset, const char16_t* formula)Put the formula to the cell in the table.
PutCellFormula(int32_t rowOffset, int32_t columnOffset, const U16String& formula, bool isTotalsRowFormula)Put the formula to the cell in the table.
PutCellFormula(int32_t rowOffset, int32_t columnOffset, const char16_t* formula, bool isTotalsRowFormula)Put the formula to the cell in the table.
PutCellValue(int32_t rowOffset, int32_t columnOffset, const Aspose::Cells::Object& value)Put the value to the cell.
PutCellValue(int32_t rowOffset, int32_t columnOffset, const Aspose::Cells::Object& value, bool isTotalsRowLabel)Put the value to the cell.
RemoveAutoFilter()Removes auto filter which is applied to this table.
Resize(int32_t startRow, int32_t startColumn, int32_t endRow, int32_t endColumn, bool hasHeaders)Resize the range of the list object.
SetAlternativeDescription(const U16String& value)Gets and sets the alternative description.
SetAlternativeDescription(const char16_t* value)Gets and sets the alternative description.
SetAlternativeText(const U16String& value)Gets and sets the alternative text.
SetAlternativeText(const char16_t* value)Gets and sets the alternative text.
SetComment(const U16String& value)Gets and sets the comment of the table.
SetComment(const char16_t* value)Gets and sets the comment of the table.
SetDisplayName(const U16String& value)Gets and sets the display name of the table.
SetDisplayName(const char16_t* value)Gets and sets the display name of the table.
SetHasAutoFilter(bool value)Indicates whether auto filter is applied to this table.
SetShowHeaderRow(bool value)Gets and sets whether this Table shows header row.
SetShowTableStyleColumnStripes(bool value)Indicates whether column stripe formatting is applied to.
SetShowTableStyleFirstColumn(bool value)Indicates whether the first column in the table is the style applied to.
SetShowTableStyleLastColumn(bool value)Indicates whether the last column in the table is the style applied to.
SetShowTableStyleRowStripes(bool value)Indicates whether row stripe formatting is applied to.
SetShowTotals(bool value)Gets and sets whether this TAble shows total row.
SetTableStyleName(const U16String& value)Gets and sets the table style name.
SetTableStyleName(const char16_t* value)Gets and sets the table style name.
SetTableStyleType(TableStyleType value)Gets and the built-in table style.
UpdateColumnName()Updates all list columns’ name to cells in the table.
~ListObject()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
Workbook workbook;
Cells cells = workbook.GetWorksheets().Get(0).GetCells();
for (int i = 0; i < 5; i++)
{
    cells.Get(0, i).PutValue(CellsHelper::ColumnIndexToName(i));
}
for (int row = 1; row < 10; row++)
{
    for (int column = 0; column < 5; column++)
    {
        cells.Get(row, column).PutValue(row * column);
    }
}
ListObjectCollection tables = workbook.GetWorksheets().Get(0).GetListObjects();
int index = tables.Add(0, 0, 9, 4, true);
ListObject table = tables.Get(0);
table.SetShowTotals(true);
table.GetListColumns().Get(4).SetTotalsCalculation(TotalsCalculation::Sum);
workbook.Save(u"Book1.xlsx");
Aspose::Cells::Cleanup();

See Also