none
HOW CAN I KNOW THE ITEM SELECTED ON A PIVOTFILTER IN A PIVOTTABLE WITH C# RRS feed

  • Question

  • HI, I AM USING C#. I NEED TO KNOW WHICH IS THE ITEM SELECTED FOR THE PIVOTFILTER BEFORE AND AFTER I  UPDATE MY PIVOT TABLE. HOW CAN I GET THE ACTIVE O SELECTED VALUE (OF PIVOTFILTER). THANKS.
    Friday, May 24, 2013 3:11 PM

Answers

All replies

  • Hi,

    Code in Excel Slicer Auto Select VBA might be helpful, although it's in VBA, the logic would be the same.

    hth


    with regards, Yuri

    Tuesday, May 28, 2013 12:59 PM
  • Thanks for reply.

    The problems is that in C# i dont have the selected property. My code is like this:

    ...

    Excel.PivotTable xlPTable = (Excel.PivotTable)xlWorkSheet.PivotTables("Tabla1");
    Excel.PivotField xlPField = (Excel.PivotField)xlPT.PivotFields("Oficina"); 

    I guess that I have o create a PivotFilter from he Pivotfield "Oficina"

    Excel.PivotFilter xlPivotfilter = (Excel.PivotFilters)xlPField.PivotFilter;

    ...

    After this how I know the selected value of the Pivotfilter "Oficina". I don't want to changed the value, i only want to know what offices or "Oficina" is selected.

    Thanks for your help.

    • Edited by i112233 Tuesday, May 28, 2013 2:57 PM
    Tuesday, May 28, 2013 2:53 PM
  • Hi,

     The thread in my last reply have showed you how to use slicer.

    Slicer Object (Excel)
    Slicers are used to filter data in PivotTable reports or OLAP data sources.

    HTH


    with regards, Yuri

    Wednesday, May 29, 2013 11:49 AM
  • THANKS BUT I NEED IT IN EXCEL 2007.

    Tuesday, June 4, 2013 2:33 PM