ListColumn class

ListColumn class

Represents a column in a Table.

The ListColumn type exposes the following members:

Properties

PropertyDescription
nameGets and sets the name of the column.
totals_calculationGets and sets the type of calculation in the Totals row of the list column.
rangeGets the range of this list column.
formulaGets and sets the formula of the list column.
totals_row_labelGets and sets the display labels of total row.

Methods

MethodDescription
get_custom_totals_row_formula(self, is_r1c1, is_local)Gets the formula of totals row of this list column.
set_custom_totals_row_formula(self, formula, is_r1c1, is_local)Gets the formula of totals row of this list column.
get_custom_calculated_formula(self, is_r1c1, is_local)Gets the formula of this list column.
set_custom_calculated_formula(self, formula, is_r1c1, is_local)Sets the formula for this list column.
get_data_style(self)Gets the style of the data in this column of the table.
set_data_style(self, style)Sets the style of the data in this column of the table.

Example

from aspose.cells import CellsHelper, Workbook
from aspose.cells.tables import TotalsCalculation

workbook = Workbook()
cells = workbook.worksheets[0].cells
for i in range(5):
    cells.get(0, i).put_value(CellsHelper.column_index_to_name(i))
for row in range(1, 10):
    for column in range(4):
        cells.get(row, column).put_value(row * column)
tables = workbook.worksheets[0].list_objects
index = tables.add(0, 0, 9, 4, True)
table = tables[0]
table.show_totals = True
listColumn = table.list_columns[4]
listColumn.totals_calculation = TotalsCalculation.SUM
listColumn.formula = "=[A]"
workbook.save(r"Book1.xlsx")

See Also