ピボット テーブル オプションの設定 - 空の場合 Cells 表示
Contents
[
Hide
]
Aspose.Cells を使用して、さまざまなピボット テーブル オプションを設定できます。そのようなオプションの 1 つに、「空のセルを表示する」があります。このオプションを設定すると、ピボット テーブル内のすべての空のセルが指定された文字列で表示されます。
Microsoft Excel でこのオプションを見つけて設定するには:
- ピボット テーブルを選択して右クリックします。
- 選択するピボットテーブル オプション.
- を選択レイアウトとフォーマットタブ。
- を選択空のセルが表示される場合オプションを選択して文字列を指定します。
Aspose.Cells はPivotTable.setDisplayNullString()とPivotTable.setNullString()[空のセルを表示] ピボット テーブル オプションを設定するためのプロパティ。
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
// 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"); |