显示报告筛选页面选项

显示报告筛选页面选项

Excel 支持创建数据透视表、添加报表筛选器并启用“显示报表筛选器页面”选项。 Aspose.Cells 还支持此功能以在创建的数据透视表上启用“显示报表筛选页面”选项。以下是显示 Excel 中的“显示报表筛选页面”选项的屏幕。

待办事项:图片_替代_文本

可以从此处下载示例源文件和输出文件以测试示例代码:

 源 Excel 文件 

输出 Excel 文件

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Load template file
Workbook wb = new Workbook(sourceDir + "samplePivotTable.xlsx");
// Get first pivot table in the worksheet
PivotTable pt = wb.Worksheets[1].PivotTables[0];
// Set pivot field
pt.ShowReportFilterPage(pt.PageFields[0]);
// Set position index for showing report filter pages
pt.ShowReportFilterPageByIndex(pt.PageFields[0].Position);
// Set the page field name
pt.ShowReportFilterPageByName(pt.PageFields[0].Name);
// Save the output file
wb.Save(outputDir + "outputSamplePivotTable.xlsx");