设置数据透视表选项 对空单元格显示
Contents
[
Hide
]
你可以使用Aspose.Cells for Node.js via C++设置不同的数据透视表选项。其中一种选项是"空单元格显示"。设置此选项后,所有空单元格将显示为指定的字符串。
在Microsoft Excel中设置数据透视表选项
要在Microsoft Excel中查找并设置此选项:
- 选择数据透视表,右键单击。
- 选择数据透视表选项。
- 选择布局和格式选项卡。
- 选择对空单元格显示选项并指定字符串。
** 使用Aspose.Cells for Node.js via C++设置数据透视表选项**
Aspose.Cells for Node.js via C++提供用于设置"空单元格显示"数据透视表选项的PivotTable.setDisplayNullString和PivotTable.setNullString属性。
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"); |