[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotFilters

IPivotFilters Interface

Represents a collection of all the pivot filters in a pivot field.

This interface provides access to the label, date, and value filters defined for a pivot field. Use it to add new filters, retrieve existing filters by index, and iterate through the current IPivotFilter objects.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface IPivotFilters : IEnumerable<IPivotFilter>, IEnumerable
Public Interface IPivotFilters
    Inherits IEnumerable(Of IPivotFilter), IEnumerable
Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Product", "Amount"},
    {"Mi Phone", 100},
    {"Camera", 200},
    {"Mi Band", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "SalesPivot");
IPivotField productField = pivotTable.PivotFields["Product"];
productField.Orientation = PivotFieldOrientation.RowField;
IPivotFilters filters = productField.PivotFilters;
filters.Add(PivotFilterType.CaptionContains, "Mi");

Properties

Name Description
Count

Gets the number of pivot filters in the collection.

This property returns the current count of filters that have been added to a pivot field through PivotFilters.

this[int]

Gets the pivot filter at the specified index.

Use this property to access a filter that has already been added to the current IPivotFilters collection.

Methods

Name Description
Add(PivotFilterType, object, object, PivotFilterOptions)

Adds a new filter to the pivot filter collection.

Use this method to create a pivot filter that requires two criterion values, such as a between or not-between condition. This overload calls Add(PivotFilterType, object, object, PivotFilterOptions) with null for the options argument.