Show report filter pages option
Show report filter pages option
Excel supports creating pivot tables, adding report filters and enable the “Show Report Filter Pages” option. Aspose.Cells for Node.js via C++ 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.
Sample source file and output files can be downloaded from here for testing the sample code:
const AsposeCells = require("aspose.cells.node"); | |
//For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Load template file | |
var wb = new AsposeCells.Workbook(sourceDir + "samplePivotTable.xlsx"); | |
//Get first pivot table in the worksheet | |
var pt = wb.getWorksheets().get(1).getPivotTables().get(0); | |
//Set pivot field | |
pt.showReportFilterPage(pt.getPageFields().get(0)); | |
//Set position index for showing report filter pages | |
pt.showReportFilterPageByIndex(pt.getPageFields().get(0).getPosition()); | |
//Set the page field name | |
pt.showReportFilterPageByName(pt.getPageFields().get(0).getName()); | |
//Save the output file | |
wb.save(outputDir + "outputSamplePivotTable.xlsx"); |