[]
Deletes all filters currently applied to this PivotField.
This method removes all filters from the PivotFilters collection and also clears any manual filtering applied to the field. If the field is in the report filter area, the selected item is reset to the default item.
void ClearAllFilters()
Sub ClearAllFilters()
object[,] sourceData = new object[,] {
{"Product", "Amount"},
{"Example Speaker", 4270},
{"Example TV", 2626},
{"Example Mobile", 9062}
};
worksheet.Range["G1:H4"].Value = sourceData;
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["G1:H4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["A1"], "pivottable1");
IPivotField field = pivotTable.PivotFields["Product"];
field.Orientation = PivotFieldOrientation.RowField;
field.PivotFilters.Add(PivotFilterType.CaptionContains, "Example");
field.ClearAllFilters();