显示报表筛选页选项
Contents
[
Hide
]
如何显示报告筛选器页面选项
Excel支持创建数据透视表,添加报告筛选器并启用“显示报告筛选器页面”选项。Aspose.Cells for Python via .NET也支持此功能,以启用创建的数据透视表上的“显示报告筛选器页面”选项。以下是在Excel中显示“显示报告筛选器页面”选项的屏幕。
可从此处下载示例源文件和输出文件以测试示例代码:
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 | |
# Load template file | |
wb = Workbook(sourceDir + "samplePivotTable.xlsx") | |
# Get first pivot table in the worksheet | |
pt = wb.worksheets[1].pivot_tables[0] | |
# Set pivot field | |
pt.show_report_filter_page(pt.page_fields[0]) | |
# Set position index for showing report filter pages | |
pt.show_report_filter_page_by_index(pt.page_fields[0].position) | |
# Set the page field name | |
pt.show_report_filter_page_by_name(pt.page_fields[0].name) | |
# Save the output file | |
wb.save(outputDir + "outputSamplePivotTable.xlsx") |