Interface SPivotTable

All Known Implementing Classes:
PivotTableImpl

public interface SPivotTable
Represents a pivot table on a sheet.
Since:
7.0.0
  • Method Details

    • getName

      String getName()
      Returns the name of this pivot table.
      Returns:
      the pivot table name
    • setName

      void setName(String name)
      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

      SPivotField getField(int index)
      Returns the field at the specified index.
      Parameters:
      index - zero-based field index
      Returns:
      the pivot field
    • getFieldByName

      SPivotField getFieldByName(String name)
      Returns the first field matching the given name.
      Parameters:
      name - field name
      Returns:
      the matching field, or null if not found
    • getLayoutMode

      default SPivotTable.LayoutMode getLayoutMode()
      Returns the current layout mode. Use this in preference to the individual isCompactLayout() / isOutlineLayout() / isTabularLayout() accessors.
      Returns:
      the layout mode (never null)
      Since:
      7.0.0
    • setLayoutMode

      default void setLayoutMode(SPivotTable.LayoutMode mode)
      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. Prefer setLayoutMode(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. Prefer setLayoutMode(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. Prefer setLayoutMode(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