接口 IPivotField


public interface IPivotField
Represents a field in a PivotTable report. The PivotField object is a member of the PivotFields collection. The PivotFields collection contains all the fields in a PivotTable report, including hidden fields.
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    Establishes automatic field-sorting rules for PivotTable reports.
    void
    autoSort(SortOrder Order, String Field)
    Establishes automatic field-sorting rules for PivotTable reports.
    void
    Deletes all filters currently applied to the PivotField.
    void
    Provides an easy way to set the Visible property to True for all items of a PivotField in PivotTables, and to empty the HiddenItemsList and VisibleItemsList collections in OLAP PivotTables.
    boolean
    Retrieves a value that indicates whether any manual filtering is applied to Pivotfield.
    Returns the name of the data field used to sort the specified PivotTable field automatically.
    Returns the order used to sort the specified PivotTable field automatically.
    Gets the base field for a custom calculation.
    Gets the item in the base field for a custom calculation.
    Returns a ICalculatedItems collection that represents all the calculated items in the specified PivotTable report.
    Gets a PivotFieldCalculation value that represents the type of calculation performed by the specified field.This property is valid only for data fields.
    int
    Gets the current page's index showing for the page field (valid only for page fields).
    boolean
    Gets whether the specified field can be dragged to the column position.
    boolean
    Gets whether the specified field can be dragged to the data position.
    boolean
    Gets whether the field can be hidden by being dragged off the PivotTable report.
    boolean
    Gets whether the field can be dragged to the page position.
    boolean
    Gets whether the field can be dragged to the row position.
    boolean
    Gets whether the field can have multiple items selected in the page field.
    Gets a String value that represents the object's formula in A1-style notation and in the language of the macro.
    Gets the function used to summarize the PivotTable field (data fields only).
    boolean
    Gets if a blank row is inserted after the specified row field in a PivotTable report.
    boolean
    Gets whether or not a PivotField is compacted(items of multiple PivotFields are displayed in a single column) when rows are selected.
    Returns the way the specified PivotTable items appear — in table format or in outline format.
    Gets the position of the PivotTable field subtotals in relation to (either above or below) the specified field.
    Gets the name of the object.
    Gets the format code for the object.
    Gets the location of the field in the specified PivotTable report.
    Returns a collection of all the visible and hidden items in the specified field.
    int
    Gets the position of the field (first, second, third, and so on) among all the fields in its orientation (Rows, Columns, Pages, Data).
    boolean
    Gets whether item labels are repeated in the PivotTable for the specified PivotField.
    boolean
    Gets if all items in the PivotTable report are displayed, even if they don’t contain summary data.
    Returns the specified object’s name as it appears in the original source data for the specified PivotTable report.
    void
    Sets the base field for a custom calculation.
    void
    Sets the item in the base field for a custom calculation.
    void
    Sets a PivotFieldCalculation value that represents the type of calculation performed by the specified field.This property is valid only for data fields.
    void
    setCurrentPage(int value)
    Sets the current page's index showing for the page field (valid only for page fields).
    void
    setDragToColumn(boolean value)
    Sets whether the specified field can be dragged to the column position.
    void
    setDragToData(boolean value)
    Sets whether the specified field can be dragged to the data position.
    void
    setDragToHide(boolean value)
    Sets whether the field can be hidden by being dragged off the PivotTable report.
    void
    setDragToPage(boolean value)
    Sets whether the field can be dragged to the page position.
    void
    setDragToRow(boolean value)
    Sets whether the field can be dragged to the row position.
    void
    Sets whether the field can have multiple items selected in the page field.
    void
    Sets a String value that represents the object's formula in A1-style notation and in the language of the macro.
    void
    Sets the function used to summarize the PivotTable field (data fields only).
    void
    setLayoutBlankLine(boolean value)
    Sets if a blank row is inserted after the specified row field in a PivotTable report.
    void
    setLayoutCompactRow(boolean value)
    Sets whether or not a PivotField is compacted(items of multiple PivotFields are displayed in a single column) when rows are selected.
    void
    Sets the way the specified PivotTable items appear — in table format or in outline format.
    void
    Sets the position of the PivotTable field subtotals in relation to (either above or below) the specified field.
    void
    setName(String value)
    Sets the name of the object.
    void
    Sets the format code for the object.
    void
    Sets the location of the field in the specified PivotTable report.
    void
    setPosition(int value)
    Sets the position of the field (first, second, third, and so on) among all the fields in its orientation (Rows, Columns, Pages, Data).
    void
    setRepeatLabels(boolean value)
    Sets whether item labels are repeated in the PivotTable for the specified PivotField.
    void
    setShowAllItems(boolean value)
    Sets if all items in the PivotTable report are displayed, even if they don’t contain summary data.
  • 方法详细资料

    • getAllItemsVisible

      boolean getAllItemsVisible()
      Retrieves a value that indicates whether any manual filtering is applied to Pivotfield.
    • getAutoSortField

      String getAutoSortField()
      Returns the name of the data field used to sort the specified PivotTable field automatically.
    • getAutoSortOrder

      SortOrder getAutoSortOrder()
      Returns the order used to sort the specified PivotTable field automatically.
    • getBaseField

      String getBaseField()
      Gets the base field for a custom calculation. This property is valid only for data fields.
    • setBaseField

      void setBaseField(String value)
      Sets the base field for a custom calculation. This property is valid only for data fields.
    • getBaseItem

      String getBaseItem()
      Gets the item in the base field for a custom calculation. Valid only for data fields.
    • setBaseItem

      void setBaseItem(String value)
      Sets the item in the base field for a custom calculation. Valid only for data fields.
    • getCalculation

      PivotFieldCalculation getCalculation()
      Gets a PivotFieldCalculation value that represents the type of calculation performed by the specified field.This property is valid only for data fields.
    • setCalculation

      void setCalculation(PivotFieldCalculation value)
      Sets a PivotFieldCalculation value that represents the type of calculation performed by the specified field.This property is valid only for data fields.
    • getCurrentPage

      int getCurrentPage()
      Gets the current page's index showing for the page field (valid only for page fields). The valid value is based on zero. "-1" indicates "All" or "Multiple Items".
    • setCurrentPage

      void setCurrentPage(int value)
      Sets the current page's index showing for the page field (valid only for page fields). The valid value is based on zero. "-1" indicates "All" or "Multiple Items".
    • getDragToColumn

      boolean getDragToColumn()
      Gets whether the specified field can be dragged to the column position. The default value is True.
    • setDragToColumn

      void setDragToColumn(boolean value)
      Sets whether the specified field can be dragged to the column position. The default value is True.
    • getDragToData

      boolean getDragToData()
      Gets whether the specified field can be dragged to the data position. The default value is True.
    • setDragToData

      void setDragToData(boolean value)
      Sets whether the specified field can be dragged to the data position. The default value is True.
    • getDragToHide

      boolean getDragToHide()
      Gets whether the field can be hidden by being dragged off the PivotTable report. The default value is True.
    • setDragToHide

      void setDragToHide(boolean value)
      Sets whether the field can be hidden by being dragged off the PivotTable report. The default value is True.
    • getDragToPage

      boolean getDragToPage()
      Gets whether the field can be dragged to the page position. The default value is True.
    • setDragToPage

      void setDragToPage(boolean value)
      Sets whether the field can be dragged to the page position. The default value is True.
    • getDragToRow

      boolean getDragToRow()
      Gets whether the field can be dragged to the row position. The default value is True.
    • setDragToRow

      void setDragToRow(boolean value)
      Sets whether the field can be dragged to the row position. The default value is True.
    • getEnableMultiplePageItems

      boolean getEnableMultiplePageItems()
      Gets whether the field can have multiple items selected in the page field. The default value is false.
    • setEnableMultiplePageItems

      void setEnableMultiplePageItems(boolean value)
      Sets whether the field can have multiple items selected in the page field. The default value is false.
    • getFormula

      String getFormula()
      Gets a String value that represents the object's formula in A1-style notation and in the language of the macro.
    • setFormula

      void setFormula(String value)
      Sets a String value that represents the object's formula in A1-style notation and in the language of the macro.
    • getFunction

      ConsolidationFunction getFunction()
      Gets the function used to summarize the PivotTable field (data fields only).
    • setFunction

      void setFunction(ConsolidationFunction value)
      Sets the function used to summarize the PivotTable field (data fields only).
    • getLayoutBlankLine

      boolean getLayoutBlankLine()
      Gets if a blank row is inserted after the specified row field in a PivotTable report. The default value is False.
    • setLayoutBlankLine

      void setLayoutBlankLine(boolean value)
      Sets if a blank row is inserted after the specified row field in a PivotTable report. The default value is False.
    • getLayoutCompactRow

      boolean getLayoutCompactRow()
      Gets whether or not a PivotField is compacted(items of multiple PivotFields are displayed in a single column) when rows are selected.
    • setLayoutCompactRow

      void setLayoutCompactRow(boolean value)
      Sets whether or not a PivotField is compacted(items of multiple PivotFields are displayed in a single column) when rows are selected.
    • getLayoutForm

      LayoutFormType getLayoutForm()
      Returns the way the specified PivotTable items appear — in table format or in outline format.
    • setLayoutForm

      void setLayoutForm(LayoutFormType value)
      Sets the way the specified PivotTable items appear — in table format or in outline format.
    • getLayoutSubtotalLocation

      SubtotalLocationType getLayoutSubtotalLocation()
      Gets the position of the PivotTable field subtotals in relation to (either above or below) the specified field.
    • setLayoutSubtotalLocation

      void setLayoutSubtotalLocation(SubtotalLocationType value)
      Sets the position of the PivotTable field subtotals in relation to (either above or below) the specified field.
    • getName

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

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

      String getNumberFormat()
      Gets the format code for the object.
    • setNumberFormat

      void setNumberFormat(String value)
      Sets the format code for the object.
    • getOrientation

      PivotFieldOrientation getOrientation()
      Gets the location of the field in the specified PivotTable report.
    • setOrientation

      void setOrientation(PivotFieldOrientation value)
      Sets the location of the field in the specified PivotTable report.
    • getPosition

      int getPosition()
      Gets the position of the field (first, second, third, and so on) among all the fields in its orientation (Rows, Columns, Pages, Data).
    • setPosition

      void setPosition(int value)
      Sets the position of the field (first, second, third, and so on) among all the fields in its orientation (Rows, Columns, Pages, Data).
    • getRepeatLabels

      boolean getRepeatLabels()
      Gets whether item labels are repeated in the PivotTable for the specified PivotField.
      返回:
    • setRepeatLabels

      void setRepeatLabels(boolean value)
      Sets whether item labels are repeated in the PivotTable for the specified PivotField.
    • getShowAllItems

      boolean getShowAllItems()
      Gets if all items in the PivotTable report are displayed, even if they don’t contain summary data. The default value is False.
    • setShowAllItems

      void setShowAllItems(boolean value)
      Sets if all items in the PivotTable report are displayed, even if they don’t contain summary data. The default value is False.
    • getSourceName

      String getSourceName()
      Returns the specified object’s name as it appears in the original source data for the specified PivotTable report. This might be different from the current item name if the user renamed the item after creating the PivotTable report.
    • autoSort

      void autoSort(SortOrder Order, String Field)
      Establishes automatic field-sorting rules for PivotTable reports.
      参数:
      Order - Required SortOrder. The sort order.
      Field - The name of the sort key field. You must specify the unique name (as returned from the IPivotField.getSourceName()) and not the displayed name.
    • autoSort

      void autoSort(SortOrder Order)
      Establishes automatic field-sorting rules for PivotTable reports.
      参数:
      Order - Required SortOrder. The sort order.
    • clearAllFilters

      void clearAllFilters()
      Deletes all filters currently applied to the PivotField. This includes deleting all filters from the PivotFilters collection of the PivotField and removing any manual filtering applied to the PivotField as well. If the PivotField is in the Report Filter area, the item selected will be set to the default item.
    • clearManualFilter

      void clearManualFilter()
      Provides an easy way to set the Visible property to True for all items of a PivotField in PivotTables, and to empty the HiddenItemsList and VisibleItemsList collections in OLAP PivotTables.
    • getPivotItems

      IPivotItems getPivotItems()
      Returns a collection of all the visible and hidden items in the specified field.
    • getCalculatedItems

      ICalculatedItems getCalculatedItems()
      Returns a ICalculatedItems collection that represents all the calculated items in the specified PivotTable report.
      返回:
      CalculatedItems collection