The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

PivotItem.Formula Property

Gets or sets the formula for the calculated item.

Namespace: DevExpress.Spreadsheet

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

Declaration

string Formula { get; set; }
Property Formula As String
string Formula { get; set; }
Property Formula As String

Property Value

Type Description
String

A String value that is the calculated item's formula.

Property Value

Type Description
String

A String value that is the calculated item's formula.

Remarks

Use the Formula property to modify the formula of the existing calculated item. To add a calculated item to a specific field, use the PivotCalculatedItemCollection.Add method of the PivotField.CalculatedItems collection.

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

' Access the pivot table by its name in the collection.
Dim pivotTable As PivotTable = worksheet.PivotTables("PivotTable1")

' Access the pivot field by its name in the collection.
Dim field As PivotField = pivotTable.Fields("Customer")

' Add a calculated item to the "Customer" field.
Dim item As PivotItem = field.CalculatedItems.Add("='Big Foods'*110%", "Big Foods Sales Plan")

'Change the formula for the calculated item.
item.Formula = "='Big Foods'*115%"

For the field items that originate from the source data, the Formula property returns an empty string.

See Also