In excel pivot tables, you drag a column to the “Report Filter” area, then you can select that filter and check the “Select Multiple Items” box. I want the filter to select all the items EXCEPT “x” and “y”.
But I’ve searched the forums here and can’t see anything that works. Here’s what I’m trying, but it doesn’t have any effect:
//Is this the right way to get the field in the “Report Filter” section?
var x = pivotTable.Fields(Aspose.Cells.Pivot.PivotFieldType.Page);
var fieldToFilterOn = x[0];
//And is this the right way to filter out the two bad values?
int baseIndex = fieldToFilterOn.BaseIndex;
int index = pivotTable.PivotFilters.Add(baseIndex, Aspose.Cells.Pivot.PivotFilterType.CaptionNotEqual);
var filter = pivotTable.PivotFilters[index];
filter.Value1 = “x,y”;
Cause that doesn’t seem to set the filters right. Is there something else I should do?