Mostra l opzione delle pagine filtro del report

Mostra l’opzione pagine filtro report

Excel supporta la creazione di tabelle pivot, l’aggiunta di filtri report e l’abilitazione dell’opzione “Mostra pagine filtro report”. Aspose.Cells for Node.js via C++ supporta anche questa funzione per abilitare l’opzione “Mostra pagine filtro report” sulla tabella pivot creata. Di seguito è mostrato lo schermo che evidenzia l’opzione “Mostra pagine filtro report” in Excel.

todo:image_alt_text

Il file di origine e i file di output di esempio possono essere scaricati da qui per testare il codice di esempio:

 File Excel di origine 

File Excel di output

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");