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”. Genom att ställa in det här alternativet visas alla tomma celler i en pivottabell som en specificerad sträng.
Ställa in pivottabellalternativ i Microsoft Excel
För att hitta och ställa in det här alternativet i Microsoft Excel:
- Välj en pivottabell och högerklicka.
- VäljPivottabellalternativ.
- VäljLayout & Format flik.
- VäljFör tomma celler visa alternativet och ange en sträng.
Ställa in pivottabellalternativ med Aspose.Cells
Aspose.Cells tillhandahållerPivotTable.DisplayNullString ochPivotTable.NullString egenskaper för att ställa in pivottabellalternativet “Visa tomma celler”.
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-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
Workbook wb = new Workbook(dataDir + "input.xlsx"); | |
PivotTable pt = wb.Worksheets[0].PivotTables[0]; | |
// Indicating if or not display the empty cell value | |
pt.DisplayNullString = true; | |
// Indicating the null string | |
pt.NullString = "null"; | |
pt.CalculateData(); | |
pt.RefreshDataOnOpeningFile = false; | |
wb.Save(dataDir+ "output_out.xlsx"); |