Package io.keikai.model
Interface SPivotTable
- All Known Implementing Classes:
PivotTableImpl
public interface SPivotTable
Represents a pivot table on a sheet.
- Since:
- 7.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumPivot table layout modes. -
Method Summary
Modifier and TypeMethodDescriptionReturns all fields defined in this pivot table.getCache()Returns the pivot cache backing this pivot table.Returns the fields placed on the column axis.Returns the data (value) fields.getField(int index) Returns the field at the specified index.getFieldByName(String name) Returns the first field matching the given name.default SPivotTable.LayoutModeReturns the current layout mode.Returns the output location of this pivot table on the sheet.getName()Returns the name of this pivot table.Returns the fields placed on the page (report filter) axis.Returns the fields placed on the row axis.booleanReturns whether compact layout is enabled.booleanReturns whether outline layout is enabled.booleanReturns whether the grand total column is shown.booleanReturns whether the grand total row is shown.booleanReturns whether tabular layout is enabled.voidrefresh()Refreshes the pivot table by re-reading data from the cache.voidsetCompactLayout(boolean compact) Sets compact layout mode.default voidSets the layout mode.voidSets the name of this pivot table.voidsetOutlineLayout(boolean outline) Sets outline layout mode.voidsetShowGrandTotalColumn(boolean show) Sets visibility of the grand total column.voidsetShowGrandTotalRow(boolean show) Sets visibility of the grand total row.voidsetTabularLayout(boolean tabular) Sets tabular layout mode.
-
Method Details
-
getName
String getName()Returns the name of this pivot table.- Returns:
- the pivot table name
-
setName
Sets the name of this pivot table.- Parameters:
name- the pivot table name
-
getLocation
CellRegion getLocation()Returns the output location of this pivot table on the sheet.- Returns:
- the cell region where the pivot table is rendered
-
getCache
SPivotCache getCache()Returns the pivot cache backing this pivot table.- Returns:
- the pivot cache
-
getRowFields
List<SPivotField> getRowFields()Returns the fields placed on the row axis.- Returns:
- list of row fields
-
getColumnFields
List<SPivotField> getColumnFields()Returns the fields placed on the column axis.- Returns:
- list of column fields
-
getDataFields
List<SPivotDataField> getDataFields()Returns the data (value) fields.- Returns:
- list of data fields
-
getPageFields
List<SPivotField> getPageFields()Returns the fields placed on the page (report filter) axis.- Returns:
- list of page fields
-
getAllFields
List<SPivotField> getAllFields()Returns all fields defined in this pivot table.- Returns:
- list of all fields
-
getField
Returns the field at the specified index.- Parameters:
index- zero-based field index- Returns:
- the pivot field
-
getFieldByName
Returns the first field matching the given name.- Parameters:
name- field name- Returns:
- the matching field, or null if not found
-
getLayoutMode
Returns the current layout mode. Use this in preference to the individualisCompactLayout()/isOutlineLayout()/isTabularLayout()accessors.- Returns:
- the layout mode (never null)
- Since:
- 7.0.0
-
setLayoutMode
Sets the layout mode. Mutually exclusive: switching to one mode turns the others off.- Parameters:
mode- the layout mode (must not be null)- Since:
- 7.0.0
-
isCompactLayout
boolean isCompactLayout()Returns whether compact layout is enabled.- Returns:
- true if compact layout
-
setCompactLayout
void setCompactLayout(boolean compact) Sets compact layout mode. PrefersetLayoutMode(LayoutMode)for clarity — this setter is kept for backward compatibility.- Parameters:
compact- true to enable compact layout
-
isOutlineLayout
boolean isOutlineLayout()Returns whether outline layout is enabled.- Returns:
- true if outline layout
-
setOutlineLayout
void setOutlineLayout(boolean outline) Sets outline layout mode. PrefersetLayoutMode(LayoutMode).- Parameters:
outline- true to enable outline layout
-
isTabularLayout
boolean isTabularLayout()Returns whether tabular layout is enabled.- Returns:
- true if tabular layout
-
setTabularLayout
void setTabularLayout(boolean tabular) Sets tabular layout mode. PrefersetLayoutMode(LayoutMode).- Parameters:
tabular- true to enable tabular layout
-
isShowGrandTotalRow
boolean isShowGrandTotalRow()Returns whether the grand total row is shown.- Returns:
- true if the grand total row is visible
-
setShowGrandTotalRow
void setShowGrandTotalRow(boolean show) Sets visibility of the grand total row.- Parameters:
show- true to show grand total row
-
isShowGrandTotalColumn
boolean isShowGrandTotalColumn()Returns whether the grand total column is shown.- Returns:
- true if the grand total column is visible
-
setShowGrandTotalColumn
void setShowGrandTotalColumn(boolean show) Sets visibility of the grand total column.- Parameters:
show- true to show grand total column
-
refresh
void refresh()Refreshes the pivot table by re-reading data from the cache.Until the pivot calculation engine is implemented this throws
UnsupportedOperationException(fail-loud) rather than silently no-op'ing, so callers cannot mistake a stale table for a refreshed one.- Throws:
UnsupportedOperationException- until the pivot engine lands
-