Cambiare il Layout della Tabella Pivot
Come cambiare il layout della tabella pivot in MS-Excel
Microsoft Excel ti permette di cambiare il layout della tabella pivot usando i comandi del menu Strumenti tabella pivot > Design > Layout rapporto. Puoi cambiare il layout in queste tre forme
- Mostra in forma compatta
- Mostra in forma di contorno
- Mostra in forma tabellare
Come modificare il layout della tabella pivot usando Aspose.Cells for Node.js via C++
La libreria Aspose.Cells for Node.js via C++ fornisce anche i metodi PivotTable.showInCompactForm(), PivotTable.showInOutlineForm() e PivotTable.showInTabularForm() per cambiare il layout della tabella pivot in queste tre forme.
Codice di Esempio
Il seguente codice di esempio mostra prima la tabella pivot in Forma compatta, poi mostra la tabella pivot in Forma di contorno e infine mostra la tabella pivot in Forma tabellare.
const AsposeCells = require("aspose.cells.node"); | |
//For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
//The path to the documents directory. | |
var dataDir = RunExamples.GetDataDir(".") | |
//Create workbook object from source excel file | |
var workbook = new AsposeCells.Workbook(dataDir + "pivotTable_sample.xlsx"); | |
//Access first worksheet | |
var worksheet = workbook.getWorksheets().get(0); | |
//Access first pivot table | |
var pivotTable = worksheet.getPivotTables().get(0); | |
//1 - Show the pivot table in compact form | |
pivotTable.showInCompactForm(); | |
//Refresh the pivot table | |
pivotTable.refreshData(); | |
pivotTable.calculateData(); | |
//Save the output | |
workbook.save(dataDir + "CompactForm_out.xlsx"); | |
//2 - Show the pivot table in outline form | |
pivotTable.showInOutlineForm(); | |
//Refresh the pivot table | |
pivotTable.refreshData(); | |
pivotTable.calculateData(); | |
//Save the output | |
workbook.save(dataDir + "OutlineForm_out.xlsx"); | |
//3 - Show the pivot table in tabular form | |
pivotTable.showInTabularForm(); | |
//Refresh the pivot table | |
pivotTable.refreshData(); | |
pivotTable.calculateData(); | |
//Save the output | |
workbook.save(dataDir + "TabularForm_out.xlsx"); |