Using Interop library I can add the page field within a pivot table and toggle as true or false which filter I would want to show.
- Code: Select all
//(Interop code)
PivotTable pvt = xlWorkSheet.PivotTables("PivotByTest") as PivotTable;
PivotField pfTMonth = (PivotField)pvt.PivotFields("Month");
pfTMonth.Orientation = XlPivotFieldOrientation.xlPageField;
pfTMonth.EnableMultiplePageItems = true;
for (int i = 1; i <= pfTMonth.PivotItems().count; i++)
{
if (pfTMonth.PivotItems(i).Value.ToLower() != "(blank)")
pfTMonth.PivotItems(i).Visible = (pfTMonth.PivotItems(i).Value == DateTime.Now.ToString("MMMM"));
else
pfTMonth.PivotItems(i).Visible = false;
}
I know that the pagefield can be targeted by
- Code: Select all
//(Spire.XLS code)
pvt.PageFields[0]
Is there a way to manipulate them as showing true or false?