Click or drag to resize

PivotFieldCollectionAddCalculated Method

Adds a calculated PivotField to the end of the collection of PivotTable fields.

Namespace:  GemBox.Spreadsheet.PivotTables
Assembly:  GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 43.0.35.1066
Syntax
public PivotField AddCalculated(
	string fieldName,
	string formula
)

Parameters

fieldName
Type: SystemString
The name of the calculated PivotField.
formula
Type: SystemString
The formula of the calculated PivotField.

Return Value

Type: PivotField
Newly created PivotField.
Exceptions
ExceptionCondition
InvalidOperationExceptionPivotTable created from non-worksheet data source cannot be modified.
ArgumentExceptionfieldName can't be or Empty.
ArgumentExceptionformula can't be or Empty.
ArgumentExceptionfieldName must be unique.
See Also