Get the Cell object by DisplayName of PivotField of PivotTable
Contents
[
Hide
]
Aspose.Cells provides PivotTable.getCellByDisplayName() method which you can use to access the cell object by the display name of the pivot field. This method is useful when you want to highlight or format your pivot field header. This article explains how to retrieve the cell object by the display name of the data field and then apply formatting to it.
Get the Cell object by DisplayName of PivotField of PivotTable
The following code accesses the first pivot table of the worksheet and then gets cell by the display name of the second data field of the pivot table. It then changes the fill color and font color of the cell to light blue and black respectively. Below screenshots show how the pivot table looks before and after the execution of the code.