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);
workbook.save("C:\\Book1.xlsx");
Method Summary |
void | applyStyleToRange() | |
Apply the table style to the range.
|
void | convertToRange() | |
Convert the table to range.
|
void | resize(int startRow, int startColumn, int endRow, int endColumn, boolean hasHeaders) | |
Resize the range of the list object.
|
void | updateColumnName() | |
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.
-
Gets ListColumns of the ListObject.
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.
-
Gets auto filter.
getDisplayName/setDisplayName | |
public java.lang.String getDisplayName() / public void setDisplayName(java.lang.String value)
|
-
Gets and sets the display name.
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.
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.
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.
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.