Bir Çalışma Sayfasından Pivot Tablosunu Sil
Contents
[
Hide
]
Aspose.Cells for Node.js via C++, bir Çalışma Sayfasından Pivot Tablo silme veya kaldırma özelliği sağlar. Pivot tablo nesnesini veya pivot tablo konumunu kullanarak pivot tabloyu silebilirsiniz. Pivot tabloyu silmek için, pivot tablo nesnesi kullanılarak Worksheet.getPivotTables().remove(pivotTable) yöntemini ve Pivot tablo koleksiyonundaki konum kullanılarak Worksheet.getPivotTables().removeAt(index, keepData) yöntemini kullanın.
Aspose.Cells for Node.js via C++ kullanarak Çalışma Sayfasından Pivot Tablo nasıl silinir
Aşağıdaki örnek kod, çalışma sayfasından iki pivot tablosunu siler. İlk önce Worksheet.getPivotTables().remove(pivotTable) yöntemini kullanarak pivot tablosunu kaldırır, ardından Worksheet.getPivotTables().removeAt(index, keepData) yöntemini kullanarak pivot tablosunu kaldırır.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 + "source.xlsx"); | |
// Access the first worksheet | |
var worksheet = workbook.getWorksheets().get(0); | |
// Access the first pivot table object | |
var pivotTable = worksheet.getPivotTables().get(0); | |
// Remove pivot table using pivot table object | |
worksheet.getPivotTables().remove(pivotTable); | |
// OR you can remove pivot table using pivot table position by uncommenting below line | |
//worksheet.getPivotTables().removeAt(0); | |
// Save the workbook | |
workbook.save(dataDir + "output_out.xlsx"); |