Définir l option du tableau croisé dynamique Afficher les cellules vides

Comment définir l’option Tableau croisé dynamique dans Microsoft Excel

Pour trouver et définir cette option dans Microsoft Excel :

  1. Sélectionnez un tableau croisé dynamique et faites un clic droit.
  2. Sélectionnez Options du tableau croisé dynamique.
  3. Sélectionnez l’onglet Mise en page et format.
  4. Sélectionnez l’option Afficher pour les cellules vides et spécifiez une chaîne.

Comment définir l’option Tableau croisé dynamique en utilisant la bibliothèque Excel Aspose.Cells pour Python

Aspose.Cells pour Python via .NET offre les propriétés PivotTable.display_null_string et PivotTable.null_string pour définir l’option de tableau croisé dynamique “Afficher pour les cellules vides”.

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")

Articles Connexes