ピボットテーブルオプションの設定 空白セルに表示する内容を設定する
Contents
[
Hide
]
紹介
Aspose.Cellsを使用して、さまざまなピボットテーブルオプションを設定できます。そのようなオプションの1つが"空白セルの表示"です。このオプションを設定することで、ピボットテーブルのすべての空白セルに指定された文字列が表示されます。
Microsoft Excelでこのオプションを見つけて設定するには:
- ピボットテーブルを選択し、右クリックします。
- ピボットテーブルオプションを選択します。
- レイアウトと書式タブを選択します。
- 空白のセルに表示する内容オプションを選択し、文字列を指定します。
Pivotテーブルオプションの設定方法 - 空のセルの表示
Aspose.Cells は、「空白セルの表示」ピボットテーブルオプションを設定するための PivotTable.setDisplayNullString() および PivotTable.setNullString() プロパティを提供しています。
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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(SettingPivotTableOption.class); | |
Workbook wb = new Workbook(dataDir + "input.xlsx"); | |
PivotTable pt = wb.getWorksheets().get(0).getPivotTables().get(0); | |
// Indicating if or not display the empty cell value | |
pt.setDisplayNullString(true); | |
// Indicating the null string | |
pt.setNullString("null"); | |
pt.calculateData(); | |
pt.setRefreshDataOnOpeningFile(false); | |
wb.save(dataDir + "output.xlsx"); |