com.aspose.cells

Class ListObject

  • java.lang.Object
    • com.aspose.cells.ListObject
public class ListObject 
extends java.lang.Object

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 = new 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);

Property Getters/Setters Summary
java.lang.StringgetAlternativeDescription()
void
setAlternativeDescription(java.lang.Stringvalue)
           Gets and sets the alternative description.
java.lang.StringgetAlternativeText()
void
setAlternativeText(java.lang.Stringvalue)
           Gets and sets the alternative text.
AutoFiltergetAutoFilter()
Gets auto filter.
java.lang.StringgetComment()
void
setComment(java.lang.Stringvalue)
           Gets and sets the comment of the table.
RangegetDataRange()
Gets the data range of the ListObject.
intgetDataSourceType()
Gets the data source type of the table. The value of the property is TableDataSourceType integer constant.
java.lang.StringgetDisplayName()
void
setDisplayName(java.lang.Stringvalue)
           Gets and sets the display name.
intgetEndColumn()
Gets the end column of the range.
intgetEndRow()
Gets the end row of the range.
ListColumnCollectiongetListColumns()
Gets ListColumns of the ListObject.
QueryTablegetQueryTable()
Gets the linked QueryTable.
booleangetShowHeaderRow()
void
setShowHeaderRow(booleanvalue)
           Gets and sets whether this ListObject show header row.
booleangetShowTableStyleColumnStripes()
void
           Indicates whether column stripe formatting is applied.
booleangetShowTableStyleFirstColumn()
void
           Inidicates whether the first column in the table should have the style applied.
booleangetShowTableStyleLastColumn()
void
           Indicates whether the last column in the table should have the style applied.
booleangetShowTableStyleRowStripes()
void
           Indicates whether row stripe formatting is applied.
booleangetShowTotals()
void
setShowTotals(booleanvalue)
           Gets and sets whether this ListObject show total row.
intgetStartColumn()
Gets the start column of the range.
intgetStartRow()
Gets the start row of the range.
java.lang.StringgetTableStyleName()
void
setTableStyleName(java.lang.Stringvalue)
           Gets and sets the table style name.
intgetTableStyleType()
void
           Gets and the built-in table style. The value of the property is TableStyleType integer constant.
XmlMapgetXmlMap()
Gets an XmlMap used for this list.
 
Method Summary
voidapplyStyleToRange()
Apply the table style to the range.
voidconvertToRange()
Convert the table to range.
voidconvertToRange(TableToRangeOptions options)
Convert the table to range.
voidputCellValue(int rowOffset, int columnOffset, java.lang.Object value)
Put the value to the cell.
voidresize(int startRow, int startColumn, int endRow, int endColumn, boolean hasHeaders)
Resize the range of the list object.
voidupdateColumnName()
Updates all list columns' name from the worksheet.
 

    • Property Getters/Setters Detail

      • getStartRow

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

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

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

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

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

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

        public Range getDataRange()
        
        Gets the data range of the ListObject.
      • getQueryTable

        public QueryTable getQueryTable()
        
        Gets the linked QueryTable.
      • getDataSourceType

        public int getDataSourceType()
        
        Gets the data source type of the table. The value of the property is TableDataSourceType integer constant.
      • getAutoFilter

        public AutoFilter getAutoFilter()
        
        Gets auto filter.
      • getDisplayName/setDisplayName

        public java.lang.String getDisplayName() / public void setDisplayName(java.lang.String value)
        
        Gets and sets the display name.
      • getComment/setComment

        public java.lang.String getComment() / public void setComment(java.lang.String value)
        
        Gets and sets the comment of the table.
      • getShowTableStyleFirstColumn/setShowTableStyleFirstColumn

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

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

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

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

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

        public java.lang.String getTableStyleName() / public void setTableStyleName(java.lang.String value)
        
        Gets and sets the table style name.
      • getXmlMap

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

        public java.lang.String getAlternativeText() / public void setAlternativeText(java.lang.String value)
        
        Gets and sets the alternative text.
      • getAlternativeDescription/setAlternativeDescription

        public java.lang.String getAlternativeDescription() / public void setAlternativeDescription(java.lang.String value)
        
        Gets and sets the alternative description.

    setShowHeaderRow

    public voidsetShowHeaderRow(booleanvalue)
    
    Gets and sets whether this ListObject show header row.

    setShowTotals

    public voidsetShowTotals(booleanvalue)
    
    Gets and sets whether this ListObject show total row.

    setDisplayName

    public voidsetDisplayName(java.lang.Stringvalue)
    
    Gets and sets the display name.

    setComment

    public voidsetComment(java.lang.Stringvalue)
    
    Gets and sets the comment of the table.

    setShowTableStyleFirstColumn

    public voidsetShowTableStyleFirstColumn(booleanvalue)
    
    Inidicates whether the first column in the table should have the style applied.

    setShowTableStyleLastColumn

    public voidsetShowTableStyleLastColumn(booleanvalue)
    
    Indicates whether the last column in the table should have the style applied.

    setShowTableStyleRowStripes

    public voidsetShowTableStyleRowStripes(booleanvalue)
    
    Indicates whether row stripe formatting is applied.

    setShowTableStyleColumnStripes

    public voidsetShowTableStyleColumnStripes(booleanvalue)
    
    Indicates whether column stripe formatting is applied.

    setTableStyleType

    public voidsetTableStyleType(intvalue)
    
    Gets and the built-in table style. The value of the property is TableStyleType integer constant.

    setTableStyleName

    public voidsetTableStyleName(java.lang.Stringvalue)
    
    Gets and sets the table style name.

    setAlternativeText

    public voidsetAlternativeText(java.lang.Stringvalue)
    
    Gets and sets the alternative text.

    setAlternativeDescription

    public voidsetAlternativeDescription(java.lang.Stringvalue)
    
    Gets and sets the alternative description.
    • Method Detail

      • resize

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

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

        public void 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

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

        public void convertToRange()
        Convert the table to range.
      • convertToRange

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