ピボットテーブルリボンの無効化
Contents
[
Hide
]
ピボットテーブルを基にしたレポートは便利ですが、対象ユーザーがこれらのレポートを構成するための詳細な知識を持っていない場合、エラーの発生箇所になります。このような状況では、組織はユーザーがピボットテーブルを変更できないようにしたいと考えるでしょう。報告書の作成中にこれらの報告書を変更できないようにするために、Excelはピボットテーブルリボンを無効にする機能を提供しており、Aspose.Cells for Python via .NETでも同様の機能が提供されています。つまり、開発者はこれらのレポートを変更できないようにするためにリボンを無効にできます。
Aspose.Cells for Python Excelライブラリを使用してピボットテーブルリボンを無効にする方法
次のコードは、シートからピボットテーブルを取得し、enable_wizardをfalseに設定することでこの機能を示しています。サンプルのピボットテーブルファイルは、このリンクからダウンロードできます。
This file contains 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
from aspose.cells import Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# Open the template file containing the pivot table | |
wb = Workbook("pivot_table_test.xlsx") | |
# Access the pivot table in the first sheet | |
pt = wb.worksheets[0].pivot_tables[0] | |
# Disable ribbon for this pivot table | |
pt.enable_wizard = False | |
# Save output file | |
wb.save("out.xlsx") |