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 Python Excel Kütüphanesi Kullanarak Pivot Tablosunun Düzenini Değiştirme

Aspose.Cells for Python excel kütüphanesi ayrıca bu üç biçimde pivot tablosunun düzenini değiştirmek için PivotTable.show_in_compact_form(), PivotTable.show_in_outline_form() ve PivotTable.show_in_tabular_form() yöntemlerini sağlar.

Ö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.

from aspose.cells import Workbook
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# The path to the documents directory.
dataDir = RunExamples.GetDataDir(".")
# Create workbook object from source excel file
workbook = Workbook(dataDir + "pivotTable_sample.xlsx")
# Access first worksheet
worksheet = workbook.worksheets[0]
# Access first pivot table
pivotTable = worksheet.pivot_tables[0]
# 1 - Show the pivot table in compact form
pivotTable.show_in_compact_form()
# Refresh the pivot table
pivotTable.refresh_data()
pivotTable.calculate_data()
# Save the output
workbook.save(dataDir + "CompactForm_out.xlsx")
# 2 - Show the pivot table in outline form
pivotTable.show_in_outline_form()
# Refresh the pivot table
pivotTable.refresh_data()
pivotTable.calculate_data()
# Save the output
workbook.save(dataDir + "OutlineForm_out.xlsx")
# 3 - Show the pivot table in tabular form
pivotTable.show_in_tabular_form()
# Refresh the pivot table
pivotTable.refresh_data()
pivotTable.calculate_data()
# Save the output
workbook.save(dataDir + "TabularForm_out.xlsx")