レポートフィルターページのオプションを表示
Contents
[
Hide
]
レポートフィルターページのオプションを表示
Excelはピボットテーブルの作成、レポートフィルターの追加、および「Show Report Filter Pages」オプションの有効化をサポートしています。Aspose.Cellsもこの機能をサポートし、作成したピボットテーブルで「Show Report Filter Pages」オプションを有効にすることができます。以下は、Excelでの「Show Report Filter Pages」オプションを示す画面です。
サンプルソースファイルと出力ファイルは、テスト用のサンプルコードをダウンロードできます:
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
// 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"); |