PivotField PivotField PivotField Interface

Definition

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.

public interface class PivotField
[System.Runtime.InteropServices.Guid("00020874-0000-0000-C000-000000000046")]
[System.Runtime.InteropServices.InterfaceType(2)]
public interface PivotField
Public Interface PivotField
Attributes

Remarks

Use PivotFields(index), where index is the field name or index number, to return a single PivotField object.

In some cases, it may be easier to use one of the properties that returns a subset of the PivotTable fields. The following properties are available:

Properties

_Default _Default _Default

Reserved for internal use.

AllItemsVisible AllItemsVisible AllItemsVisible

Retrieves a value that indicates whether or not any manual filtering is applied to the Microsoft.Office.Interop.Excel.Pivotfield. Read-only.

Application Application Application

Returns an _Application object that represents the Microsoft Excel application. Read-only.

AutoShowCount AutoShowCount AutoShowCount

Returns the number of top or bottom items that are automatically shown in the specified PivotTable field. Read-only Integer.

AutoShowField AutoShowField AutoShowField

Returns the name of the data field used to determine the top or bottom items that are automatically shown in the specified PivotTable field. Read-only String.

AutoShowRange AutoShowRange AutoShowRange

Returns xlTop if the top items are shown automatically in the specified PivotTable field; returns xlBottom if the bottom items are shown. Read-only Integer.

AutoShowType AutoShowType AutoShowType

Returns xlAutomatic if AutoShow(Int32, Int32, Int32, String) is enabled for the specified PivotTable field; returns xlManual if AutoShow is disabled. Read-only Integer.

AutoSortCustomSubtotal AutoSortCustomSubtotal AutoSortCustomSubtotal

Returns an integer corresponding to the custom subtotal used to sort the specified PivotTable field automatically. Read-only.

AutoSortField AutoSortField AutoSortField

Returns the name of the data field used to sort the specified PivotTable field automatically. Read-only String.

AutoSortOrder AutoSortOrder AutoSortOrder

Returns the order used to sort the specified PivotTable field automatically. Can be one of the XlSortOrder constants. Read-only Integer.

AutoSortPivotLine AutoSortPivotLine AutoSortPivotLine

Returns the PivotLine used to sort the specified PivotTable field automatically. Read-only.

BaseField BaseField BaseField

Returns or sets the base field for a custom calculation. This property is valid only for data fields. Read/write Object.

BaseItem BaseItem BaseItem

Returns or sets the item in the base field for a custom calculation. Valid only for data fields. Read/write Object.

Calculation Calculation Calculation

Returns or sets the type of calculation performed by the specified field. This property is valid only for data fields. Read/write XlPivotFieldCalculation.

Caption Caption Caption

The label text for the pivot field. Read-only String.

ChildField ChildField ChildField

Returns a PivotField object that represents the child field for the specified field (if the field is grouped and has a child field). Read-only.

ChildItems[Object] ChildItems[Object] ChildItems[Object]

Returns an object that represents either a single PivotTable item (a PivotItem object) or a collection of all the items (a PivotItems object) that are group children in the specified field, or children of the specified item. Read-only.

Creator Creator Creator

Returns a 32-bit integer that indicates the application in which this object was created. If the object was created in Microsoft Excel, this property returns the string XCEL, which is equivalent to the hexadecimal number 5843454C. Read-only XlCreator.

CubeField CubeField CubeField

Returns the CubeField object from which the specified PivotTable field is descended. Read-only.

CurrentPage CurrentPage CurrentPage

Returns or sets the current page showing for the page field (valid only for page fields). Read/write Object.

CurrentPageList CurrentPageList CurrentPageList

Returns or sets an array of strings corresponding to the list of items included in a multiple-item page field of a PivotTable report. Read/write Object.

CurrentPageName CurrentPageName CurrentPageName

Returns or sets the currently displayed page of the specified PivotTable report. The name of the page appears in the page field. Note that this property works only if the currently displayed page already exists. Read/write String.

DatabaseSort DatabaseSort DatabaseSort

When set to True, manual repositioning of items in a PivotTable field is allowed. Returns True if the field has no manually positioned items. Read/write Boolean.

DataRange DataRange DataRange

Returns a Range object. Read-only.

DataType DataType DataType

Returns a constant describing the type of data in the PivotTable field. Read-only XlPivotFieldDataType.

DisplayAsCaption DisplayAsCaption DisplayAsCaption

This property is used to display member properties of PivotFields as captions. Read-only.

DisplayAsTooltip DisplayAsTooltip DisplayAsTooltip

This property is used to specify whether or not a specific member property PivotField is displayed in tooltips. Read/write.

DisplayInReport DisplayInReport DisplayInReport

This property is used to specify whether the specified member property PivotField is displayed in the PivotTable or not. Read/write.

DragToColumn DragToColumn DragToColumn

True if the specified field can be dragged to the column position. The default value is True. Read/write Boolean.

DragToData DragToData DragToData

True if the specified field can be dragged to the data position. The default value is True. Read/write Boolean.

DragToHide DragToHide DragToHide

True if the field can be hidden by being dragged off the PivotTable report. The default value is True. Read/write Boolean.

DragToPage DragToPage DragToPage

True if the field can be dragged to the page position. The default value is True. Read/write Boolean.

DragToRow DragToRow DragToRow

True if the field can be dragged to the row position. The default value is True. Read/write Boolean.

DrilledDown DrilledDown DrilledDown

True if the flag for the specified PivotTable field or PivotTable item is set to "drilled" (expanded, or visible). Read/write Boolean.

EnableItemSelection EnableItemSelection EnableItemSelection

When set to False, disables the ability to use the field dropdown in the user interface. The default value is True. Read/write Boolean.

EnableMultiplePageItems EnableMultiplePageItems EnableMultiplePageItems

Used for specifying whether or not check boxes are present in the filter drop-down list for fields in the page area. Read/write.

Formula Formula Formula

Returns or sets the object's formula in A1-style notation Read/write String.

Function Function Function

Returns or sets the function used to summarize the PivotTable field (data fields only). Read/write XlConsolidationFunction.

GroupLevel GroupLevel GroupLevel

Returns the placement of the specified field within a group of fields (if the field is a member of a grouped set of fields). Read-only.

Hidden Hidden Hidden

This property is used to hide the individual levels of an OLAP hierarchy. Read/write.

HiddenItems[Object] HiddenItems[Object] HiddenItems[Object]

Returns an object that represents either a single hidden PivotTable item (a PivotItem object) or a collection of all the hidden items (a PivotItems object) in the specified field. Read-only.

HiddenItemsList HiddenItemsList HiddenItemsList

Returns or sets an Object specifying an array of strings that are hidden items for a PivotTable field. Read/write.

IncludeNewItemsInFilter IncludeNewItemsInFilter IncludeNewItemsInFilter

Allows developers to specify whether excluded or included items should be tracked when manual filtering is applied to the PivotField. Read/write.

IsCalculated IsCalculated IsCalculated

True if the PivotTable field or PivotTable item is a calculated field or item. Read-only Boolean.

IsMemberProperty IsMemberProperty IsMemberProperty

Returns True when the PivotField contains member properties. Read-only Boolean.

LabelRange LabelRange LabelRange

For a PivotField object, returns a Range object that represents the cell (or cells) that contain the field label. For a PivotItem object, returns a Range object that represents all the cells in the PivotTable report that contain the item. Read-only.

LayoutBlankLine LayoutBlankLine LayoutBlankLine

True if a blank row is inserted after the specified row field in a PivotTable report. The default value is False. Read/write Boolean.

LayoutCompactRow LayoutCompactRow LayoutCompactRow

Specifies whether or not a PivotField is compacted (items of multiple PivotFields are displayed in a single column) when rows are selected. Read/write.

LayoutForm LayoutForm LayoutForm

Returns or sets the way the specified PivotTable items appear — in table format or in outline format. Read/write XlLayoutFormType.

LayoutPageBreak LayoutPageBreak LayoutPageBreak

True if a page break is inserted after each field. The default value is False. Read/write Boolean.

LayoutSubtotalLocation LayoutSubtotalLocation LayoutSubtotalLocation

Returns or sets the position of the PivotTable field subtotals in relation to (either above or below) the specified field. Read/write XlSubtototalLocationType.

MemberPropertyCaption MemberPropertyCaption MemberPropertyCaption

Setting the MemberPropertyCaption property controls which member property is used as caption for a given level. Read/write.

MemoryUsed MemoryUsed MemoryUsed

Returns the amount of memory in bytes currently being used by the object. Read-only Integer.

Name Name Name

Returns or sets the name of the object. Read/write String.

NumberFormat NumberFormat NumberFormat

Returns or sets the format code for the object. Read/write String.

Orientation Orientation Orientation

The location of the field in the specified PivotTable report. Read/write XlPivotFieldOrientation.

Parent Parent Parent

Returns the parent object for the specified object. Read-only.

ParentField ParentField ParentField

Returns a PivotField object that represents the PivotTable field that’s the group parent of the specified object. The field must be grouped and must have a parent field. Read-only.

ParentItems[Object] ParentItems[Object] ParentItems[Object]

Returns an object that represents either a single PivotTable item (a PivotItem object) or a collection of all the items (a PivotItems object) that are group parents in the specified field. The specified field must be a group parent of another field. Read-only.

PivotFilters PivotFilters PivotFilters

Returns or sets the PivotFilters for the specified PivotField object. Read-only.

Position Position Position

Position of the field (first, second, third, and so on) among all the fields in its orientation (Rows, Columns, Pages, Data). Read/write Object.

PropertyOrder PropertyOrder PropertyOrder

Valid only for PivotTable fields that are member property fields. Returns an Integer indicating the display position of the member property within the cube field to which it belongs. Read/write.

PropertyParentField PropertyParentField PropertyParentField

Returns a PivotField object representing the field to which the properties in this field pertain.

RepeatLabels RepeatLabels RepeatLabels

Gets or sets whether item labels are repeated in the PivotTable for the specified PivotField.

ServerBased ServerBased ServerBased

True if the data source for the specified PivotTable report is external and only the items matching the page field selection are retrieved. Read/write Boolean.

ShowAllItems ShowAllItems ShowAllItems

True if all items in the PivotTable report are displayed, even if they don’t contain summary data. The default value is False. Read/write Boolean.

ShowDetail ShowDetail ShowDetail

Gets or sets whether the specified PivotField is showing detail. Read/write.

ShowingInAxis ShowingInAxis ShowingInAxis

Indicates if the PivotField is currently visible in the PivotTable or not. Read-only.

SourceCaption SourceCaption SourceCaption

The SourceCaption property is applicable only for OLAP PivotTables, and returns the original caption from the OLAP server for a PivotField. Read-only.

SourceName SourceName SourceName

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. Read-only String.

StandardFormula StandardFormula StandardFormula

Returns or sets a String specifying formulas with standard English (United States) formatting. Read/write.

SubtotalName SubtotalName SubtotalName

Returns or sets the text string label displayed in the subtotal column or row heading in the specified PivotTable report. The default value is the string "Subtotal". Read/write String.

Subtotals[Object] Subtotals[Object] Subtotals[Object]

Returns or sets subtotals displayed with the specified field. Valid only for non-data fields. Read/write Object.

TotalLevels TotalLevels TotalLevels

Returns the total number of fields in the current field group. If the field isn’t grouped, or if the data source is OLAP-based, TotalLevels returns the value 1. Read-only Integer.

UseMemberPropertyAsCaption UseMemberPropertyAsCaption UseMemberPropertyAsCaption

This property is used to control whether member property captions are used for PivotItem captions of the PivotField. Read/write.

Value Value Value

The name of the specified field in the PivotTable report. Read/write String.

VisibleItems[Object] VisibleItems[Object] VisibleItems[Object]

Returns an object that represents either a single visible PivotTable item (a PivotItem object) or a collection of all the visible items (a PivotItems object) in the specified field. Read-only.

VisibleItemsList VisibleItemsList VisibleItemsList

Returns or sets a Object specifying an array of strings that represent included items in a manual filter applied to a PivotField. Read/write.

Methods

AddPageItem(String, Object) AddPageItem(String, Object) AddPageItem(String, Object)

Adds an additional item to a multiple item page field.

AutoShow(Int32, Int32, Int32, String) AutoShow(Int32, Int32, Int32, String) AutoShow(Int32, Int32, Int32, String)

Displays the number of top or bottom items for a row, page, or column field in the specified PivotTable report.

AutoSort(Int32, String) AutoSort(Int32, String) AutoSort(Int32, String)

Establishes automatic field-sorting rules for PivotTable reports.

AutoSortEx(Int32, String, Object, Object) AutoSortEx(Int32, String, Object, Object) AutoSortEx(Int32, String, Object, Object)
CalculatedItems() CalculatedItems() CalculatedItems()

Returns a CalculatedItems collection that represents all the calculated items in the specified PivotTable report. Read-only.

ClearAllFilters() ClearAllFilters() ClearAllFilters()

Calling this method 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.

ClearLabelFilters() ClearLabelFilters() ClearLabelFilters()

This method deletes all label filters or all date filters in the PivotFilters collection of the PivotField.

ClearManualFilter() ClearManualFilter() 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.

ClearValueFilters() ClearValueFilters() ClearValueFilters()

Calling this method deletes all value filters in the PivotFilters collection of the PivotField.

Delete() Delete() Delete()

Deletes the object.

DrillTo(String) DrillTo(String) DrillTo(String)

The DrillTo method supports drilling to a specified PivotField from another PivotField.

PivotItems(Object) PivotItems(Object) PivotItems(Object)

Returns an object that represents either a single PivotTable item (a PivotItem object) or a collection of all the visible and hidden items (a PivotItems object) in the specified field. Read-only.

Applies to