[]
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 IPivotField
Retrieves a value that indicates whether any manual filtering is applied to Pivotfield.
bool AllItemsVisible { get; }
Returns the name of the data field used to sort the specified PivotTable field automatically.
string AutoSortField { get; }
Returns the order used to sort the specified PivotTable field automatically.
SortOrder? AutoSortOrder { get; }
Gets or sets the base field for a custom calculation. This property is valid only for data fields.
string BaseField { get; set; }
Gets or sets the item in the base field for a custom calculation. Valid only for data fields.
string BaseItem { get; set; }
Gets or sets a PivotFieldCalculation value that represents the type of calculation performed by the specified field. This property is valid only for data fields.
PivotFieldCalculation Calculation { get; set; }
Gets or 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".
int CurrentPage { get; set; }
Gets or sets whether the specified field can be dragged to the column position. The default value is True.
bool DragToColumn { get; set; }
Gets or sets whether the specified field can be dragged to the data position. The default value is True.
bool DragToData { get; set; }
Gets or sets whether the field can be hidden by being dragged off the PivotTable report. The default value is True.
bool DragToHide { get; set; }
Gets or sets whether the field can be dragged to the page position. The default value is True.
bool DragToPage { get; set; }
Gets or sets whether the field can be dragged to the row position. The default value is True.
bool DragToRow { get; set; }
Gets or sets whether the field can have multiple items selected in the page field. The default value is false.
bool EnableMultiplePageItems { get; set; }
Returns or sets a String value that represents the object's formula in A1-style notation and in the language of the macro.
string Formula { get; set; }
Gets or sets the function used to summarize the PivotTable field (data fields only). This object is read or write.
ConsolidationFunction Function { get; set; }
True if a blank row is inserted after the specified row field in a PivotTable report. The default value is False.
bool LayoutBlankLine { get; set; }
Specifies whether or not a PivotField is compacted(items of multiple PivotFields are displayed in a single column) when rows are selected.
bool LayoutCompactRow { get; set; }
Returns or sets the way the specified PivotTable items appear — in table format or in outline format.
LayoutFormType LayoutForm { get; set; }
Gets or sets the position of the PivotTable field subtotals in relation to (either above or below) the specified field.
SubtotalLocationType LayoutSubtotalLocation { get; set; }
Gets or sets the name of the object (read or write).
string Name { get; set; }
Gets or sets the format code for the object.
string NumberFormat { get; set; }
Gets or sets the location of the field in the specified PivotTable report.
PivotFieldOrientation Orientation { get; set; }
Get the filter set of the current IPivotField.
IPivotFilters PivotFilters { get; }
Returns a collection of all the visible and hidden items in the specified field.
IPivotItems PivotItems { get; }
Gets or sets the position of the field (first, second, third, and so on) among all the fields in its orientation (Rows, Columns, Pages, Data).
int Position { get; set; }
Gets or sets whether item labels are repeated in the PivotTable for the specified PivotField.
bool RepeatLabels { get; set; }
True if all items in the PivotTable report are displayed, even if they don’t contain summary data. The default value is False.
bool ShowAllItems { get; set; }
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.
string SourceName { get; }
Gets or sets a combination of all the showing subtotal types in the specified PivotField. Valid only for nondata fields.
SubtotalType Subtotals { get; set; }
Establishes automatic field-sorting rules for PivotTable reports.
void AutoSort(SortOrder? order, string field = null)
order
SortOrder?Required SortOrder. The sort order.
field
stringThe name of the sort key field. You must specify the unique name (as returned from the PivotField.SourceName property) and not the displayed name.
Returns a ICalculatedItems collection that represents all the calculated items in the specified PivotTable report.
ICalculatedItems CalculatedItems()
CalculatedItems collection.
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.
void ClearAllFilters()
This method deletes all label filters or all date filters in the PivotFilters collection of the PivotField.
void ClearLabelFilter()
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.
void ClearManualFilter()
This method deletes all value filters in the PivotFilters collection of the PivotField.
void ClearValueFilter()