none
How to get definedName of a pageField? RRS feed

  • Question

  • Hello,

    I have a an excel file that contains a pivotTable with a filter (pageField). I've given the cell where the filter is a name (definedName). I have trouble getting the definedName of the pageField. How would I go around doing this using .Net and C#. 

    In my example I actually have multiple page fields that i can get from the pivotTable1.xml - but i can see no relation between that and workbook.xml where my <DefinedNames> is defined.

    Any help would be much appreciated :)

    Thursday, June 24, 2010 11:53 AM

All replies

  • Hi mortenbpost,

    Thanks for your question.

    As far as I know, I think the relation should be the cell address (like "Sheet1!$E$4") which could help you find definedName. The definedName is stored in workbook.xml like this:

      <x:definedNames>
        <x:definedName name="PageField">Sheet1!$E$4:$F$4</x:definedName>
      </x:definedNames>

    Thanks,

    Lu

    Monday, June 28, 2010 9:07 AM
  • Hi Lu, thanks for you answer.

     

    Yes I can get the definedNames the way you mention. The problem is that I have a pivotTable with pageFields (filters). Each of these filters I've defined as a definedName so I can reference them through excel services as parameters.

    Now basically I'm trying to find all parameters defined with the prefix Filter_ which I can do like you're saying. Now I look in the pivotTable.xml file and I see 

     

      <pageField fld="29" hier="135" name="[Dimension].[Hierachy].[All]" cap="All" />

    Which I would like to link to the definedName found in the workbook.xml but I see no way of doing this.

     

    Any suggestions?


    Thanks again 

    Monday, June 28, 2010 9:18 AM