Show report filter pages option

How to Show report filter pages option

Excel supports creating pivot tables, adding report filters and enable the “Show Report Filter Pages” option. Aspose.Cells for Python via .NET also supports this feature to enable the “Show Report Filter Pages” option on the created pivot table. Following is the screen showing the “Show Report Filter Pages” option in Excel.

todo:image_alt_text

Sample source file and output files can be downloaded from here for testing the sample code:

 Source Excel File 

Output Excel File

from aspose.cells import Workbook
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# Load template file
wb = Workbook(sourceDir + "samplePivotTable.xlsx")
# Get first pivot table in the worksheet
pt = wb.worksheets[1].pivot_tables[0]
# Set pivot field
pt.show_report_filter_page(pt.page_fields[0])
# Set position index for showing report filter pages
pt.show_report_filter_page_by_index(pt.page_fields[0].position)
# Set the page field name
pt.show_report_filter_page_by_name(pt.page_fields[0].name)
# Save the output file
wb.save(outputDir + "outputSamplePivotTable.xlsx")