ピボットテーブルオプションの設定 空白セルに表示する内容を設定する
Contents
[
Hide
]
Aspose.Cells for Python via .NETを使用して、異なるピボットテーブルオプションを設定できます。そのようなオプションの1つは「空のセルを表示」です。このオプションを設定することで、ピボットテーブルのすべての空白セルが指定された文字列として表示されます。
Microsoft Excelでピボットテーブルオプションを設定する方法
Microsoft Excelでこのオプションを見つけて設定するには:
- ピボットテーブルを選択し、右クリックします。
- ピボットテーブルオプションを選択します。
- レイアウトと書式タブを選択します。
- 空白のセルに表示する内容オプションを選択し、文字列を指定します。
Aspose.Cells for Python Excelライブラリを使用してピボットテーブルオプションを設定する方法
Aspose.Cells for Python via .NETは、「空のセルを表示」ピボットテーブルオプションを設定するための PivotTable.display_null_string および PivotTable.null_string プロパティを提供します。
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 | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
wb = Workbook(dataDir + "input.xlsx") | |
pt = wb.worksheets[0].pivot_tables[0] | |
# Indicating if or not display the empty cell value | |
pt.display_null_string = True | |
# Indicating the null string | |
pt.null_string = "null" | |
pt.calculate_data() | |
pt.refresh_data_on_opening_file = False | |
wb.save(dataDir + "output_out.xlsx") |