接口 IPivotTable


public interface IPivotTable
Represents a PivotTable report on a worksheet. The PivotTable object is a member of the PivotTables collection. The PivotTables collection contains all the PivotTable objects on a single worksheet.
  • 方法概要

    修饰符和类型
    方法
    说明
    Adds a data field to a PivotTable report.
    void
    Deletes all filters currently applied to the PivotTable.
    void
    Clears a PivotTable.
    Returns a CalculatedFields collection that represents all the calculated fields in the specified PivotTable report.
    Returns an object that represents a collection of all the fields that are currently shown as column fields.
    boolean
    Gets whether the PivotTable report shows grand totals for columns.
    Returns a Range object that represents the range that contains the column area in the PivotTable report.
    int
    Returns the indent increment for PivotItems when compact row layout form is turned on.
    Returns a Range object that represents the range that contains the data area in the list between the header row and the insert row.
    Returns an object that represents a collection of all the fields that are currently shown as data fields.
    boolean
    Returns whether the pivotTable defer layout update.
    boolean
    Gets whether tooltips are displayed for PivotTable cells.
    boolean
    Gets if the PivotTable report displays a custom error string in cells that contain errors.
    boolean
    Gets whether to display member properties in tooltips.
    boolean
    Gets if the PivotTable report displays a custom string in cells that contain null values.
    Returns the string displayed in cells that contain errors when the PivotTable.getDisplayErrorString() is True.
    Gets the text string label that is displayed in the grand total column or row heading in the specified PivotTable report.
    This property specifies the layout settings for PivotFields when they are added to the PivotTable for the first time.
    boolean
    Gets if the specified PivotTable report’s outer-row item, column item, subtotal, and grand total labels use merged cells.
    Gets the name of the object.
    Returns the string displayed in cells that contain null values when the PivotTable.DisplayNullString property is True.
    Returns the order in which page fields are added to the PivotTable report’s layout.
    Returns an object that represents a collection of all the fields that are currently showing as page fields.
    int
    Returns the number of page fields in each column or row in the PivotTable report.
    Returns a Range object that represents the range that contains the page area in the PivotTable report.
    Returns a PivotCache object that represents the cache for the specified PivotTable report.
    Returns a PivotAxis object representing the entire column axis.
    Returns an object that represents either a single PivotTable field (a PivotField object) or a collection of both the visible and hidden fields (a PivotFields object) in the PivotTable report.
    Gets a PivotFormulas object that represents the collection of formulas for the specified PivotTable report.
    Returns a PivotAxis object representing the entire row axis.
    Returns an object that represents either a collection of all the fields that are currently showing as row fields.
    boolean
    Gets whether the PivotTable report shows grand totals for rows.
    Returns a Range object that represents the range including the row area on the PivotTable report.
    boolean
    Gets the boolean value if the column headers should be displayed in the PivotTable.
    boolean
    Gets the boolean value displays banded columns in which even columns are formatted differently from odd columns.
    boolean
    Gets the boolean value if displays grand total columns style.
    boolean
    Gets the boolean value if the row headers should be displayed in the PivotTable.
    boolean
    Gets the boolean value displays banded rows in which even rows are formatted differently from odd rows.
    Gets the style currently applied to the specified pivot table.
    Returns a Range object that represents the range containing the entire PivotTable report, but doesn’t include page fields.
    Returns a Range object that represents the range containing the entire PivotTable report, including page fields.
    Gets the style used in the body of the PivotTable report.
    Gets a string saved with the PivotTable report.
    pivotValueCell(int rowline, int columnline)
    Retrieve the PivotValueCell object for a given PivotTable provided certain row and column indices.
    boolean
    Refreshes the PivotTable report from the source data.
    void
    Sets whether to repeat item labels for all PivotFields in the specified PivotTable.
    void
    setColumnGrand(boolean value)
    Sets whether the PivotTable report shows grand totals for columns.
    void
    Sets the indent increment for PivotItems when compact row layout form is turned on.
    void
    setDeferLayoutUpdate(boolean value)
    Sets whether the pivotTable defer layout update.
    void
    Sets whether tooltips are displayed for PivotTable cells.
    void
    setDisplayErrorString(boolean value)
    Sets if the PivotTable report displays a custom error string in cells that contain errors.
    void
    Sets whether to display member properties in tooltips.
    void
    setDisplayNullString(boolean value)
    Sets if the PivotTable report displays a custom string in cells that contain null values.
    void
    Sets the string displayed in cells that contain errors when the PivotTable.getDisplayErrorString() is True.
    void
    Sets the text string label that is displayed in the grand total column or row heading in the specified PivotTable report.
    void
    This property specifies the layout settings for PivotFields when they are added to the PivotTable for the first time.
    void
    setMergeLabels(boolean value)
    Sets if the specified PivotTable report’s outer-row item, column item, subtotal, and grand total labels use merged cells.
    void
    setName(String value)
    Sets the name of the object.
    void
    Sets the string displayed in cells that contain null values when the PivotTable.DisplayNullString property is True.
    void
    Sets the order in which page fields are added to the PivotTable report’s layout.
    void
    Sets the number of page fields in each column or row in the PivotTable report.
    void
    This method is used for simultaneously setting layout options for all existing PivotFields.
    void
    setRowGrand(boolean value)
    Sets whether the PivotTable report shows grand totals for rows.
    void
    Sets if the column headers should be displayed in the PivotTable.
    void
    Sets the boolean value displays banded columns in which even columns are formatted differently from odd columns.
    void
    Sets the boolean value if displays grand total columns style.
    void
    Sets the boolean value if the row headers should be displayed in the PivotTable.
    void
    Sets the boolean value displays banded rows in which even rows are formatted differently from odd rows.
    void
    Sets the style currently applied to the specified pivot table.
    void
    Sets the style used in the body of the PivotTable report.
    void
    setTag(String value)
    Sets a string saved with the PivotTable report.
    void
    Changes the subtotal location for all existing PivotFields.
    void
    Updates the link or PivotTable report.
  • 方法详细资料

    • getColumnGrand

      boolean getColumnGrand()
      Gets whether the PivotTable report shows grand totals for columns.
    • setColumnGrand

      void setColumnGrand(boolean value)
      Sets whether the PivotTable report shows grand totals for columns.
    • getColumnFields

      IPivotFields getColumnFields()
      Returns an object that represents a collection of all the fields that are currently shown as column fields. Read-only.
    • getColumnRange

      IRange getColumnRange()
      Returns a Range object that represents the range that contains the column area in the PivotTable report.
    • getCompactRowIndent

      int getCompactRowIndent()
      Returns the indent increment for PivotItems when compact row layout form is turned on.
    • setCompactRowIndent

      void setCompactRowIndent(int value)
      Sets the indent increment for PivotItems when compact row layout form is turned on.
    • getDataBodyRange

      IRange getDataBodyRange()
      Returns a Range object that represents the range that contains the data area in the list between the header row and the insert row.
    • getDataFields

      IPivotFields getDataFields()
      Returns an object that represents a collection of all the fields that are currently shown as data fields. Read-only.
    • getDeferLayoutUpdate

      boolean getDeferLayoutUpdate()
      Returns whether the pivotTable defer layout update.
    • setDeferLayoutUpdate

      void setDeferLayoutUpdate(boolean value)
      Sets whether the pivotTable defer layout update.
    • getDisplayContextTooltips

      boolean getDisplayContextTooltips()
      Gets whether tooltips are displayed for PivotTable cells.
    • setDisplayContextTooltips

      void setDisplayContextTooltips(boolean value)
      Sets whether tooltips are displayed for PivotTable cells.
    • getDisplayErrorString

      boolean getDisplayErrorString()
      Gets if the PivotTable report displays a custom error string in cells that contain errors. The default value is False.
    • setDisplayErrorString

      void setDisplayErrorString(boolean value)
      Sets if the PivotTable report displays a custom error string in cells that contain errors.
    • getDisplayMemberPropertyTooltips

      boolean getDisplayMemberPropertyTooltips()
      Gets whether to display member properties in tooltips.
    • setDisplayMemberPropertyTooltips

      void setDisplayMemberPropertyTooltips(boolean value)
      Sets whether to display member properties in tooltips.
    • getDisplayNullString

      boolean getDisplayNullString()
      Gets if the PivotTable report displays a custom string in cells that contain null values. The default value is True.
    • setDisplayNullString

      void setDisplayNullString(boolean value)
      Sets if the PivotTable report displays a custom string in cells that contain null values.
    • getErrorString

      String getErrorString()
      Returns the string displayed in cells that contain errors when the PivotTable.getDisplayErrorString() is True. The default value is an empty string ("").
    • setErrorString

      void setErrorString(String value)
      Sets the string displayed in cells that contain errors when the PivotTable.getDisplayErrorString() is True.
    • getGrandTotalName

      String getGrandTotalName()
      Gets the text string label that is displayed in the grand total column or row heading in the specified PivotTable report. The default value is the string "Grand Total".
    • setGrandTotalName

      void setGrandTotalName(String value)
      Sets the text string label that is displayed in the grand total column or row heading in the specified PivotTable report. The default value is the string "Grand Total".
    • getLayoutRowDefault

      LayoutRowType getLayoutRowDefault()
      This property specifies the layout settings for PivotFields when they are added to the PivotTable for the first time.
    • setLayoutRowDefault

      void setLayoutRowDefault(LayoutRowType value)
      This property specifies the layout settings for PivotFields when they are added to the PivotTable for the first time.
    • getMergeLabels

      boolean getMergeLabels()
      Gets if the specified PivotTable report’s outer-row item, column item, subtotal, and grand total labels use merged cells.
    • setMergeLabels

      void setMergeLabels(boolean value)
      Sets if the specified PivotTable report’s outer-row item, column item, subtotal, and grand total labels use merged cells.
    • getName

      String getName()
      Gets the name of the object.
    • setName

      void setName(String value)
      Sets the name of the object.
    • getNullString

      String getNullString()
      Returns the string displayed in cells that contain null values when the PivotTable.DisplayNullString property is True. The default value is an empty string ("").
    • setNullString

      void setNullString(String value)
      Sets the string displayed in cells that contain null values when the PivotTable.DisplayNullString property is True.
    • getPageFieldOrder

      Order getPageFieldOrder()
      Returns the order in which page fields are added to the PivotTable report’s layout. Can be one of the following Order constants: DownThenOver or OverThenDown. The default constant is DownThenOver.
    • setPageFieldOrder

      void setPageFieldOrder(Order value)
      Sets the order in which page fields are added to the PivotTable report’s layout. Can be one of the following Order constants: DownThenOver or OverThenDown. The default constant is DownThenOver.
    • getPageFields

      IPivotFields getPageFields()
      Returns an object that represents a collection of all the fields that are currently showing as page fields. Read-only.
    • getPageFieldWrapCount

      int getPageFieldWrapCount()
      Returns the number of page fields in each column or row in the PivotTable report.
    • setPageFieldWrapCount

      void setPageFieldWrapCount(int value)
      Sets the number of page fields in each column or row in the PivotTable report.
    • getPageRange

      IRange getPageRange()
      Returns a Range object that represents the range that contains the page area in the PivotTable report.
    • getPivotColumnAxis

      IPivotAxis getPivotColumnAxis()
      Returns a PivotAxis object representing the entire column axis.
    • getPivotRowAxis

      IPivotAxis getPivotRowAxis()
      Returns a PivotAxis object representing the entire row axis.
    • getRowFields

      IPivotFields getRowFields()
      Returns an object that represents either a collection of all the fields that are currently showing as row fields. Read-only.
    • getRowGrand

      boolean getRowGrand()
      Gets whether the PivotTable report shows grand totals for rows.
    • setRowGrand

      void setRowGrand(boolean value)
      Sets whether the PivotTable report shows grand totals for rows.
    • getRowRange

      IRange getRowRange()
      Returns a Range object that represents the range including the row area on the PivotTable report.
    • getShowTableStyleColumnHeaders

      boolean getShowTableStyleColumnHeaders()
      Gets the boolean value if the column headers should be displayed in the PivotTable.
    • setShowTableStyleColumnHeaders

      void setShowTableStyleColumnHeaders(boolean value)
      Sets if the column headers should be displayed in the PivotTable.
    • getShowTableStyleColumnStripes

      boolean getShowTableStyleColumnStripes()
      Gets the boolean value displays banded columns in which even columns are formatted differently from odd columns. This makes PivotTableseasier to read.
    • setShowTableStyleColumnStripes

      void setShowTableStyleColumnStripes(boolean value)
      Sets the boolean value displays banded columns in which even columns are formatted differently from odd columns. This makes PivotTableseasier to read.
    • getShowTableStyleLastColumn

      boolean getShowTableStyleLastColumn()
      Gets the boolean value if displays grand total columns style.
    • setShowTableStyleLastColumn

      void setShowTableStyleLastColumn(boolean value)
      Sets the boolean value if displays grand total columns style.
    • getShowTableStyleRowHeaders

      boolean getShowTableStyleRowHeaders()
      Gets the boolean value if the row headers should be displayed in the PivotTable.
    • setShowTableStyleRowHeaders

      void setShowTableStyleRowHeaders(boolean value)
      Sets the boolean value if the row headers should be displayed in the PivotTable.
    • getShowTableStyleRowStripes

      boolean getShowTableStyleRowStripes()
      Gets the boolean value displays banded rows in which even rows are formatted differently from odd rows. This makes PivotTables easier to read.
    • setShowTableStyleRowStripes

      void setShowTableStyleRowStripes(boolean value)
      Sets the boolean value displays banded rows in which even rows are formatted differently from odd rows. This makes PivotTables easier to read.
    • getTableRange1

      IRange getTableRange1()
      Returns a Range object that represents the range containing the entire PivotTable report, but doesn’t include page fields.
    • getTableRange2

      IRange getTableRange2()
      Returns a Range object that represents the range containing the entire PivotTable report, including page fields.
    • getTableStyle

      String getTableStyle()
      Gets the style used in the body of the PivotTable report. The default value is a null string (no style is applied by default).
    • setTableStyle

      void setTableStyle(String value)
      Sets the style used in the body of the PivotTable report. The default value is a null string (no style is applied by default).
    • getTag

      String getTag()
      Gets a string saved with the PivotTable report.
    • setTag

      void setTag(String value)
      Sets a string saved with the PivotTable report.
    • addDataField

      IPivotField addDataField(IPivotField field, String caption, ConsolidationFunction function)
      Adds a data field to a PivotTable report. Returns a PivotField object that represents the new data field.
      参数:
      field - The unique field on the server. If the source data is Online AnalyticalProcessing (OLAP), the unique field is a cube field. If the source data is non-OLAP (non-OLAP source data), the unique field is a PivotTable field.
      caption - The label used in the PivotTable report to identify this data field.
      function - The function performed in the added data field.
    • getCalculatedFields

      ICalculatedFields getCalculatedFields()
      Returns a CalculatedFields collection that represents all the calculated fields in the specified PivotTable report.
    • clearAllFilters

      void clearAllFilters()
      Deletes all filters currently applied to the PivotTable. This includes deleting all filters in the PivotFilters collection of the PivotTable object, removing any manual filtering applied, and setting all PivotFields in the Report Filter area to the default item.
    • clearTable

      void clearTable()
      Clears a PivotTable. Clearing PivotTables includes removing all the fields and deleting all filtering and sorting applied to the PivotTables. This method resets the PivotTable to the state it had right after it was created, before any fields were added to it.
    • getPivotCache

      IPivotCache getPivotCache()
      Returns a PivotCache object that represents the cache for the specified PivotTable report.
    • getPivotFields

      IPivotFields getPivotFields()
      Returns an object that represents either a single PivotTable field (a PivotField object) or a collection of both the visible and hidden fields (a PivotFields object) in the PivotTable report.
    • pivotValueCell

      IPivotValueCell pivotValueCell(int rowline, int columnline)
      Retrieve the PivotValueCell object for a given PivotTable provided certain row and column indices.
      参数:
      rowline - The row position in the data area.
      columnline - The column position in the data area.
    • refresh

      boolean refresh()
      Refreshes the PivotTable report from the source data. Returns True if it’s successful.
    • repeatAllLabels

      void repeatAllLabels(PivotFieldRepeatLabels repeat)
      Sets whether to repeat item labels for all PivotFields in the specified PivotTable.
      参数:
      repeat - Specifies whether to repeat item labels for all PivotFields in the specified PivotTable.
    • setRowAxisLayout

      void setRowAxisLayout(LayoutRowType rowLayout)
      This method is used for simultaneously setting layout options for all existing PivotFields.
      参数:
      rowLayout - Specifies the type of layout row.
    • subtotalLocation

      void subtotalLocation(SubtotalLocationType location)
      Changes the subtotal location for all existing PivotFields. Changing the subtotal location has an immediate visual effect only for fields in outline form, but it will be set for fields in tabular form as well.
    • update

      void update()
      Updates the link or PivotTable report.
    • getStyle

      ITableStyle getStyle()
      Gets the style currently applied to the specified pivot table.
    • setStyle

      void setStyle(ITableStyle style)
      Sets the style currently applied to the specified pivot table.
    • getPivotFormulas

      IPivotFormulas getPivotFormulas()
      Gets a PivotFormulas object that represents the collection of formulas for the specified PivotTable report.