[]
Clears manual filtering from the PivotField.
This method sets the visible state of all items in the field to visible in PivotTables. For OLAP PivotTables, it also clears the hidden and visible item lists used by manual filtering.
void ClearManualFilter()
Sub ClearManualFilter()
worksheet.Range["A1:B5"].Value = new object[,] {
{"Region", "Amount"},
{"East", 120},
{"West", 80},
{"East", 150},
{"South", 90}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B5"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "PivotTable1");
IPivotField fieldRegion = pivotTable.PivotFields["Region"];
fieldRegion.Orientation = PivotFieldOrientation.RowField;
fieldRegion.PivotItems["West"].Visible = false;
fieldRegion.ClearManualFilter();