Inställning av pivottabellalternativ - för tom Cells Visa
Contents
[
Hide
]
Du kan ställa in olika pivottabellalternativ med Aspose.Cells. Ett sådant alternativ är “Visa för tomma celler”. Att ställa in det här alternativet innebär att alla tomma celler i pivottabellen visas med en specificerad sträng.
För att hitta och ställa in det här alternativet i Microsoft Excel:
- Välj en pivottabell och högerklicka på den.
- VäljPivottabellalternativ.
- VäljLayout & Format flik.
- VäljFör tomma celler visa alternativet och ange en sträng.
Aspose.Cells tillhandahållerPivotTable.setDisplayNullString() ochPivotTable.setNullString()egenskaper för att ställa in pivottabellalternativet “Visa tomma celler”.
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"); |