Définir l option du tableau croisé dynamique Afficher les cellules vides
Contents
[
Hide
]
Vous pouvez définir différentes options de tableau croisé dynamique avec Aspose.Cells for Node.js via C++. L’une de ces options est “Pour les cellules vides, afficher”. En réglant cette option, toutes les cellules vides dans un tableau croisé dynamique seront affichées sous forme d’une chaîne spécifique.
Définition de l’option de tableau croisé dynamique dans Microsoft Excel
Pour trouver et définir cette option dans Microsoft Excel :
- Sélectionnez un tableau croisé dynamique et faites un clic droit.
- Sélectionnez Options du tableau croisé dynamique.
- Sélectionnez l’onglet Mise en page et format.
- Sélectionnez l’option Afficher pour les cellules vides et spécifiez une chaîne.
Définir l’option de tableau croisé dynamique avec Aspose.Cells for Node.js via C++
Aspose.Cells for Node.js via C++ fournit les propriétés PivotTable.setDisplayNullString et PivotTable.setNullString pour configurer l’option “Pour les cellules vides, afficher” du tableau croisé dynamique.
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
const AsposeCells = require("aspose.cells.node"); | |
//For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
//The path to the documents directory. | |
var dataDir = RunExamples.GetDataDir("."); | |
var wb = new AsposeCells.Workbook(dataDir + "input.xlsx"); | |
var 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_out.xlsx"); |