asposecells.api

Class ListObject

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.

Example:

workbook = Workbook()
cells = workbook.getWorksheets().get(0).getCells()
for i in range(0, 5):
    cells.get(0, i).putValue(CellsHelper.columnIndexToName(i))
for row in range(1, 10):
    for column in range(0, 5):
        cells.get(row, column).putValue(row * column)

tables = workbook.getWorksheets().get(0).getListObjects()
index = tables.add(0, 0, 9, 4, True)
table = tables.get(0)
table.setShowTotals(True)
table.getListColumns().get(4).setTotalsCalculation(TotalsCalculation.SUM)
workbook.save("Book1.xlsx")

Property Getters/Setters Summary
methodgetAlternativeDescription()
method
           Gets and sets the alternative description.
methodgetAlternativeText()
method
           Gets and sets the alternative text.
methodgetAutoFilter()
Gets auto filter.
methodgetComment()
method
setComment(value)
           Gets and sets the comment of the table.
methodgetDataRange()
Gets the data range of the ListObject.
methodgetDataSourceType()
Gets the data source type of the table. The value of the property is TableDataSourceType integer constant.
methodgetDisplayName()
method
           Gets and sets the display name.
methodgetEndColumn()
Gets the end column of the range.
methodgetEndRow()
Gets the end row of the range.
methodgetListColumns()
Gets ListColumns of the ListObject.
methodgetQueryTable()
Gets the linked QueryTable.
methodgetShowHeaderRow()
method
           Gets and sets whether this ListObject show header row.
methodgetShowTableStyleColumnStripes()
method
           Indicates whether column stripe formatting is applied.
methodgetShowTableStyleFirstColumn()
method
           Inidicates whether the first column in the table should have the style applied.
methodgetShowTableStyleLastColumn()
method
           Indicates whether the last column in the table should have the style applied.
methodgetShowTableStyleRowStripes()
method
           Indicates whether row stripe formatting is applied.
methodgetShowTotals()
method
           Gets and sets whether this ListObject show total row.
methodgetStartColumn()
Gets the start column of the range.
methodgetStartRow()
Gets the start row of the range.
methodgetTableStyleName()
method
           Gets and sets the table style name.
methodgetTableStyleType()
method
           Gets and the built-in table style. The value of the property is TableStyleType integer constant.
methodgetXmlMap()
Gets an XmlMap used for this list.
 
Method Summary
methodapplyStyleToRange()
Apply the table style to the range.
methodconvertToRange()
Convert the table to range.
methodconvertToRange(options)
Convert the table to range.
methodputCellValue(rowOffset, columnOffset, value)
Put the value to the cell.
methodresize(startRow, startColumn, endRow, endColumn, hasHeaders)
Resize the range of the list object.
methodupdateColumnName()
Updates all list columns' name from the worksheet.
 

    • Property Getters/Setters Detail

      • getStartRow : int 

        int getStartRow()
        
        Gets the start row of the range.
      • getStartColumn : int 

        int getStartColumn()
        
        Gets the start column of the range.
      • getEndRow : int 

        int getEndRow()
        
        Gets the end row of the range.
      • getEndColumn : int 

        int getEndColumn()
        
        Gets the end column of the range.
      • getShowHeaderRow/setShowHeaderRow : boolean 

        boolean getShowHeaderRow() / setShowHeaderRow(value)
        
        Gets and sets whether this ListObject show header row.
      • getShowTotals/setShowTotals : boolean 

        boolean getShowTotals() / setShowTotals(value)
        
        Gets and sets whether this ListObject show total row.
      • getDataRange : Range 

        Range getDataRange()
        
        Gets the data range of the ListObject.
      • getDataSourceType : int 

        int getDataSourceType()
        
        Gets the data source type of the table. The value of the property is TableDataSourceType integer constant.
      • getDisplayName/setDisplayName : String 

        String getDisplayName() / setDisplayName(value)
        
        Gets and sets the display name.
      • getComment/setComment : String 

        String getComment() / setComment(value)
        
        Gets and sets the comment of the table.
      • getShowTableStyleFirstColumn/setShowTableStyleFirstColumn : boolean 

        boolean getShowTableStyleFirstColumn() / setShowTableStyleFirstColumn(value)
        
        Inidicates whether the first column in the table should have the style applied.
      • getShowTableStyleLastColumn/setShowTableStyleLastColumn : boolean 

        boolean getShowTableStyleLastColumn() / setShowTableStyleLastColumn(value)
        
        Indicates whether the last column in the table should have the style applied.
      • getShowTableStyleRowStripes/setShowTableStyleRowStripes : boolean 

        boolean getShowTableStyleRowStripes() / setShowTableStyleRowStripes(value)
        
        Indicates whether row stripe formatting is applied.
      • getShowTableStyleColumnStripes/setShowTableStyleColumnStripes : boolean 

        boolean getShowTableStyleColumnStripes() / setShowTableStyleColumnStripes(value)
        
        Indicates whether column stripe formatting is applied.
      • getTableStyleType/setTableStyleType : int 

        int getTableStyleType() / setTableStyleType(value)
        
        Gets and the built-in table style. The value of the property is TableStyleType integer constant.
      • getTableStyleName/setTableStyleName : String 

        String getTableStyleName() / setTableStyleName(value)
        
        Gets and sets the table style name.
      • getXmlMap : XmlMap 

        XmlMap getXmlMap()
        
        Gets an XmlMap used for this list.
      • getAlternativeText/setAlternativeText : String 

        String getAlternativeText() / setAlternativeText(value)
        
        Gets and sets the alternative text.
      • getAlternativeDescription/setAlternativeDescription : String 

        String getAlternativeDescription() / setAlternativeDescription(value)
        
        Gets and sets the alternative description.
    • Method Detail

      • resize

         resize(startRow, startColumn, endRow, endColumn, hasHeaders)
        Resize the range of the list object.
        Parameters:
        startRow: int - The start row index of the new range.
        startColumn: int - The start column index of the new range.
        endRow: int - The end row index of the new range.
        endColumn: int - The end column index of the new range.
        hasHeaders: boolean - Whether the ListObject has has headers.
      • putCellValue

         putCellValue(rowOffset, columnOffset, value)
        Put the value to the cell.
        Parameters:
        rowOffset: int - The row offset.
        columnOffset: int - The column offset.
        value: Object - The cell value.
      • updateColumnName

         updateColumnName()
        Updates all list columns' name from the worksheet. The value of the cells in the header row of the table must be same as the name of the ListColumn; Cell.PutValue do not auto modify the name of the ListColumn for performance.
      • applyStyleToRange

         applyStyleToRange()
        Apply the table style to the range.
      • convertToRange

         convertToRange()
        Convert the table to range.
      • convertToRange

         convertToRange(options)
        Convert the table to range.
        Parameters:
        options: TableToRangeOptions - the options when converting table to range.