Pivot Tablosu Yerleşimini Değiştirme
MS-Excel’de Pivot Tablosunun Düzenini Değiştirme
Microsoft Excel, PivotTable Araçları > Tasarım > Rapor Düzeni menü komutlarını kullanarak Pivot Tablosu Yerleşimini değiştirmenize izin verir. Yerleşimi bu üç biçimde değiştirebilirsiniz
- Kompakt Formda Göster
- Açıklamalı Formda Göster
- Tablo Formunda Göster
Aspose.Cells for Node.js via C++ Kullanarak Pivot Tablosunun Düzeni Nasıl Değiştirilir
Aspose.Cells for Node.js via C++ kütüphanesi ayrıca bu üç biçimde pivot tablonun düzenini değiştirmek için PivotTable.showInCompactForm(), PivotTable.showInOutlineForm() ve PivotTable.showInTabularForm() metodlarına da sahiptir.
Örnek Kod
Aşağıdaki örnek kod önce Pivot Tablosunu Kompakt Formda gösterir, ardından Pivot Tablosunu Açıklamalı Formda gösterir ve son olarak Pivot Tablosunu Tablo Formunda gösterir.
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"); |