Welcome to OpenXML Developer Sign in | Join | Help

Change Filters in PivotTable using Office Open XML

Last post 10-03-2008, 10:20 PM by Ankush Bhatia. 0 replies.
Sort Posts: Previous Next
  •  10-03-2008, 10:20 PM 3752

    Change Filters in PivotTable using Office Open XML

    Hello All,

     

    I am trying to write a program to change the Report Filter in pivot table(s) using Office Open XML SDK and would like to verify if I am on the right track.

     

    According to my research, to change the report filter, I need to make the following changes to PivotTablex.xml:

     

    Remove h attribute from the item node. This node is located under pivotField node where axis attribute is "axisPage". For ex: In the following example the last item  is the selected one.

     

    <pivotField axis="axisPage" compact="0" outline="0" subtotalTop="0" showAll="0" includeNewItemsInFilter="1">

          <items count="10">

            <item h="1" m="1" x="8" />

            <item  h="1" x="0" />

            <item x="1" />

     

    But it also expects another change as well. In PageField node, it expects item attribute to be present (As far as my test goes, the value of item attribute doesn’t matter. )

     

    <pageFields count="1">

        <pageField fld="0" item="0" hier="0" />

      </pageFields>

     

     Is my understanding correct? If not, what are the other changes I need to make this to work?

     

    Thanks,

    Ankush

View as RSS news feed in XML