public class ListObject
extends java.lang.Object
Example
Workbook workbook = new Workbook();
Cells cells = workbook.getWorksheets().get(0).getCells();
for (int i = 0; i ɝ i++)
{
cells.get(0,i).putValue(CellsHelper.columnIndexToName(i));
}
for (int row = 1; row row++)
{
for (int column = 0; column ɝ 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(com.aspose.cells.TotalsCalculation.SUM);
workbook.save("Book1.xlsx");
| Modifier and Type | Method and Description |
|---|---|
void |
applyStyleToRange()
Apply the table style to the range.
|
void |
convertToRange()
Convert the table to range.
|
void |
convertToRange(TableToRangeOptions options)
Convert the table to range.
|
AutoFilter |
filter()
Filter the table.
|
java.lang.String |
getAlternativeDescription()
Gets the alternative description.
|
java.lang.String |
getAlternativeText()
Gets the alternative text.
|
AutoFilter |
getAutoFilter()
Gets auto filter.
|
java.lang.String |
getComment()
Gets the comment of the table.
|
Range |
getDataRange()
Gets the data range of the ListObject.
|
int |
getDataSourceType()
Gets the data source type of the table.
|
java.lang.String |
getDisplayName()
Gets the display name.
|
int |
getEndColumn()
Gets the end column of the range.
|
int |
getEndRow()
Gets the end row of the range.
|
ListColumnCollection |
getListColumns()
Gets ListColumns of the ListObject.
|
QueryTable |
getQueryTable()
Gets the linked QueryTable.
|
boolean |
getShowHeaderRow()
Gets whether this ListObject show header row.
|
boolean |
getShowTableStyleColumnStripes()
Indicates whether column stripe formatting is applied.
|
boolean |
getShowTableStyleFirstColumn()
Indicates whether the first column in the table should have the style applied.
|
boolean |
getShowTableStyleLastColumn()
Indicates whether the last column in the table should have the style applied.
|
boolean |
getShowTableStyleRowStripes()
Indicates whether row stripe formatting is applied.
|
boolean |
getShowTotals()
Gets whether this ListObject show total row.
|
int |
getStartColumn()
Gets the start column of the range.
|
int |
getStartRow()
Gets the start row of the range.
|
java.lang.String |
getTableStyleName()
Gets the table style name.
|
int |
getTableStyleType()
Gets and the built-in table style.
|
XmlMap |
getXmlMap()
Gets an
getXmlMap() used for this list. |
void |
putCellFormula(int rowOffset,
int columnOffset,
java.lang.String formula)
Put the formula to the cell in the table.
|
void |
putCellFormula(int rowOffset,
int columnOffset,
java.lang.String formula,
boolean isTotalsRowFormula)
Put the formula to the cell in the table.
|
void |
putCellValue(int rowOffset,
int columnOffset,
java.lang.Object value)
Put the value to the cell.
|
void |
putCellValue(int rowOffset,
int columnOffset,
java.lang.Object value,
boolean isTotalsRowLabel)
Put the value to the cell.
|
void |
resize(int startRow,
int startColumn,
int endRow,
int endColumn,
boolean hasHeaders)
Resize the range of the list object.
|
void |
setAlternativeDescription(java.lang.String value)
Sets the alternative description.
|
void |
setAlternativeText(java.lang.String value)
Sets the alternative text.
|
void |
setComment(java.lang.String value)
Sets the comment of the table.
|
void |
setDisplayName(java.lang.String value)
Sets the display name.
|
void |
setShowHeaderRow(boolean value)
Sets whether this ListObject show header row.
|
void |
setShowTableStyleColumnStripes(boolean value)
Indicates whether column stripe formatting is applied.
|
void |
setShowTableStyleFirstColumn(boolean value)
Indicates whether the first column in the table should have the style applied.
|
void |
setShowTableStyleLastColumn(boolean value)
Indicates whether the last column in the table should have the style applied.
|
void |
setShowTableStyleRowStripes(boolean value)
Indicates whether row stripe formatting is applied.
|
void |
setShowTotals(boolean value)
Sets whether this ListObject show total row.
|
void |
setTableStyleName(java.lang.String value)
Sets the table style name.
|
void |
setTableStyleType(int value)
Gets and the built-in table style.
|
void |
updateColumnName()
Updates all list columns' name from the worksheet.
|
public int getStartRow()
public int getStartColumn()
public int getEndRow()
public int getEndColumn()
public ListColumnCollection getListColumns()
public void resize(int startRow,
int startColumn,
int endRow,
int endColumn,
boolean hasHeaders)
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 this table has headers.public void putCellValue(int rowOffset,
int columnOffset,
java.lang.Object value)
rowOffset - The row offset in the table.columnOffset - The column offset in the table.value - The cell value.public void putCellValue(int rowOffset,
int columnOffset,
java.lang.Object value,
boolean isTotalsRowLabel)
rowOffset - The row offset in the table.columnOffset - The column offset in the table.value - The cell value.isTotalsRowLabel - Indicates whether it is a label for total row,only works for total row.
If False and this row is total row, a new row will be inserted.public void putCellFormula(int rowOffset,
int columnOffset,
java.lang.String formula)
rowOffset - The row offset in the table.columnOffset - The column offset in the table.formula - The formula of the cell.public void putCellFormula(int rowOffset,
int columnOffset,
java.lang.String formula,
boolean isTotalsRowFormula)
rowOffset - The row offset in the table.columnOffset - The column offset in the table.formula - The formula of the cell.isTotalsRowFormula - public boolean getShowHeaderRow()
public void setShowHeaderRow(boolean value)
public boolean getShowTotals()
public void setShowTotals(boolean value)
public Range getDataRange()
public void updateColumnName()
Remarks
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.public QueryTable getQueryTable()
public int getDataSourceType()
See TableDataSourceType.
public AutoFilter filter()
public AutoFilter getAutoFilter()
public java.lang.String getDisplayName()
public void setDisplayName(java.lang.String value)
public java.lang.String getComment()
public void setComment(java.lang.String value)
public boolean getShowTableStyleFirstColumn()
public void setShowTableStyleFirstColumn(boolean value)
public boolean getShowTableStyleLastColumn()
public void setShowTableStyleLastColumn(boolean value)
public boolean getShowTableStyleRowStripes()
public void setShowTableStyleRowStripes(boolean value)
public boolean getShowTableStyleColumnStripes()
public void setShowTableStyleColumnStripes(boolean value)
public void applyStyleToRange()
public void convertToRange()
public void convertToRange(TableToRangeOptions options)
options - the options when converting table to range.public int getTableStyleType()
See TableStyleType.
Example
Workbook workbook = new Workbook("Book1.xlsx");
ListObjectCollection tables = workbook.getWorksheets().get(0).getListObjects();
int index = tables.add(0, 0, 9, 4, true);
ListObject table = tables.get(0);
table.setTableStyleType(TableStyleType.TABLE_STYLE_DARK_2);
workbook.save("TableStyle.xlsx");
public void setTableStyleType(int value)
See TableStyleType.
public java.lang.String getTableStyleName()
public void setTableStyleName(java.lang.String value)
public XmlMap getXmlMap()
getXmlMap() used for this list.public java.lang.String getAlternativeText()
public void setAlternativeText(java.lang.String value)
public java.lang.String getAlternativeDescription()
public void setAlternativeDescription(java.lang.String value)
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.