[]
Represents a pivot filter in the IPivotFilters collection.
An IPivotFilter describes a filter applied to a pivot field, such as
a caption, value, or date-based condition. You typically obtain an
IPivotFilter from PivotFilters after adding a
filter to a pivot field.
public interface IPivotFilter
Public Interface IPivotFilter
worksheet.Range["A1:B4"].Value = new object[,] {
{"Product", "Amount"},
{"Apple", 120},
{"Banana", 90},
{"Apricot", 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;
IPivotFilter filter = productField.PivotFilters.Add(PivotFilterType.CaptionBeginsWith, "A");
string description = filter.Description;
| Name | Description |
|---|---|
| DataField | Gets the data field that the pivot filter depends on.
For value-based pivot filters, this property returns the data field used to
evaluate the filter. For filters that do not depend on a data field, such as
label filters, this property returns |
| Description | Gets the description of the pivot filter. The description summarizes the filter criteria and can contain up to 255 characters. |
| FilterType | Gets the type of the pivot filter. |
| Name | Gets the name of the pivot filter. Use this property to retrieve the filter name for a filter created through PivotFilters. |
| PivotField | Gets the label field that the pivot filter depends on. |
| Value1 | Gets the first filter value. This value corresponds to the first criterion stored in the pivot filter. |
| Value2 | Gets the second filter value. This value is used by pivot filters that require two criteria, such as between filters. |
| WholeDayFilter | Gets or sets whether the date filter uses whole days in its filtering criteria.
When this property is |
| Name | Description |
|---|---|
| Delete() | Deletes this pivot filter. Calling this method removes the filter from the filter collection of its IPivotField. |