Aspose::Cells::Tables::ListObject class
Contents
[
Hide
]ListObject class
Represents a list object on a worksheet. The ListObject object is a member of the ListObjects collection. The ListObjects collection contains all the list objects on a worksheet.
class ListObject
Methods
| Method | Description |
|---|---|
| ApplyStyleToRange() | Apply the table style to the range. |
| ConvertToRange() | Convert the table to range. |
| ConvertToRange(const TableToRangeOptions& options) | Convert the table to range. |
| Filter() | Filter the table. |
| GetAlternativeDescription() | Gets and sets the alternative description. |
| GetAlternativeText() | Gets and sets the alternative text. |
| GetAutoFilter() | Gets auto filter. |
| GetComment() | Gets and sets the comment of the table. |
| GetDataRange() | Gets the data range of the ListObject. |
| GetDataSourceType() | Gets the data source type of the table. |
| GetDisplayName() | Gets and sets the display name. |
| GetEndColumn() | Gets the end column of the range. |
| GetEndRow() | Gets the end row of the range. |
| GetListColumns() | Gets ListColumns of the ListObject. |
| GetQueryTable() | Gets the linked QueryTable. |
| GetShowHeaderRow() | Gets and sets whether this ListObject show header row. |
| GetShowTableStyleColumnStripes() | Indicates whether column stripe formatting is applied. |
| GetShowTableStyleFirstColumn() | Indicates whether the first column in the table should have the style applied. |
| GetShowTableStyleLastColumn() | Indicates whether the last column in the table should have the style applied. |
| GetShowTableStyleRowStripes() | Indicates whether row stripe formatting is applied. |
| GetShowTotals() | Gets and sets whether this ListObject show 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() const | Checks whether the implementation object is nullptr. |
| ListObject(ListObject_Impl* impl) | Constructs from an implementation object. |
| ListObject(const ListObject& src) | Copy constructor. |
| explicit operator bool() const | operator 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. |
| 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. |
| SetDisplayName(const char16_t* value) | Gets and sets the display name. |
| SetShowHeaderRow(bool value) | Gets and sets whether this ListObject show header row. |
| SetShowTableStyleColumnStripes(bool value) | Indicates whether column stripe formatting is applied. |
| SetShowTableStyleFirstColumn(bool value) | Indicates whether the first column in the table should have the style applied. |
| SetShowTableStyleLastColumn(bool value) | Indicates whether the last column in the table should have the style applied. |
| SetShowTableStyleRowStripes(bool value) | Indicates whether row stripe formatting is applied. |
| SetShowTotals(bool value) | Gets and sets whether this ListObject show 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 from the worksheet. |
| ~ListObject() | Destructor. |
Fields
| Field | Description |
|---|---|
| _impl | The 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
- Namespace Aspose::Cells::Tables
- Library Aspose.Cells for C++