Read Pivot Filter Data



I have requirement to display the Pivot filter values on GUI. Please find the attached images which for the reference.

  • I have Pivot table which contains the values LOB, Audited_By and Download_Status.
  • When we click on the “Audited_By” filter we get different values. My requirement is that can we read these dropdown values and display it on GUI using Aspose?

Also attached the Excel file which contains Pivot tables in Sheet1

Efficiency Test (27.2 KB)

Vinay VFilter1.PNG (12.0 KB)
Filter2.PNG (16.6 KB)



Thanks for the template file, screenshots and details.

I am unable to retrieve page fields’ items in the Pivottable report. I used the following sample code using your template file to try to accomplish the task but in vain:
Sample code:

Workbook wb_demo = new Workbook("f:\\files\\Efficiency Test Data.xlsx"); 
        PivotTable pt_demo = wb_demo.getWorksheets().get(1).getPivotTables().get(0); 
        //Get the second Pivot page field 
        PivotField src_t_field = pt_demo.getPageFields().get(1); 
        System.out.println(src_t_field.getName());//Audited_By - Ok 
        System.out.println("Total Items: " + src_t_field.getItems().length);//0 - Not Ok 
        System.out.println("Total Items: " + src_t_field.getPivotItems().getCount());//0 - Not Ok 
        //This code segment is for no use 
        PivotItemCollection collection_src_t = src_t_field.getPivotItems(); 
        for (int i = 0; i < collection_src_t.getCount(); i++) 
              PivotItem item = collection_src_t.get(i); 

We need to look into it thoroughly if the code needs some tweak to accomplish the task, we will do that soon. I have logged a ticket with an id “CELLSJAVA-42750” for your issue.

Once we figure it out, we will let you know.