Inställning av pivottabellalternativ För tomma celler Visa
Contents
[
Hide
]
Du kan ställa in olika pivottabellalternativ med hjälp av Aspose.Cells för Python via .NET. Ett sådant alternativ är “Visa tomma celler”. Genom att ställa in detta alternativ visas alla tomma celler i en pivottabell som en specifierad sträng.
Hur man ställer in pivottabellalternativ i Microsoft Excel
För att hitta och ställa in detta alternativ i Microsoft Excel:
- Välj en pivottabell och högerklicka.
- Välj Pivottabellalternativ.
- Välj fliken Layout & Format.
- Välj alternativet Visa en sträng för tomma celler och ange en sträng.
Hur man ställer in pivottabellalternativ med hjälp av Aspose.Cells för Python Excel-bibliotek
Aspose.Cells för Python via .NET tillhandahåller egenskaperna PivotTable.display_null_string och PivotTable.null_string 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
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") |