.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

PivotTable.Style Property

Gets or sets the style applied to the pivot table.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v21.1.Core.dll

Declaration

TableStyle Style { get; set; }

Property Value

Type Description
TableStyle

A TableStyle object that specifies the pivot table style.

Remarks

When you create a new pivot table, the default pivot table style (TableStyleCollection.DefaultPivotStyle) is automatically applied to the created report. Use the Style property to format a pivot table with any style from the TableStyleCollection collection. For details, refer to the How to: Apply a Predefined Style to a Pivot Table and How to: Apply a Custom Style to a Pivot Table examples.

Example

Dim worksheet As Worksheet = workbook.Worksheets("Report1")
workbook.Worksheets.ActiveWorksheet = worksheet

' Access the pivot table by its name in the collection.
Dim pivotTable As PivotTable = worksheet.PivotTables("PivotTable1")
' Set the pivot table style.
pivotTable.Style = workbook.TableStyles(BuiltInPivotStyleId.PivotStyleDark7)
See Also