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 display name of 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 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 get cell by display name of 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.
Pivot Table - Before |
---|
Pivot Table - After |
---|