Skip to main content

Insert Calculated Field Dialog

  • 2 minutes to read

The Insert Calculated Field dialog allows end-users to add new calculated fields to the Pivot Table, as well as modify or remove the existing ones.

XtraSpreadsheet_InsertCalculatedFieldDialog

End-users can invoke this dialog by clicking the Calculated Field… item in the Fields, Items, & Sets drop-down menu. Add the Calculations ribbon group to enable this menu (see the Getting Started topic for details on how to provide a Ribbon UI for the SpreadsheetControl).

XtraSpreadsheet_InsertCalculatedFieldDialog_Ribbon

In the Insert Calculated Field dialog’s Name and Formula boxes, end-users can specify the name (PivotField.Name) and formula (PivotField.Formula) for a new calculated field.

The formula can contain constants and references to other fields in the PivotTable report. End-users can select the desired field in the Fields list and click the Insert Field button to include a field reference in the formula.

Clicking the Add button adds the new field to the data area of the PivotTable report.

End-users can modify the existing calculated field by selecting the desired field in the Name drop-down list and changing its formula. The calculated field’s name cannot be edited from the dialog.

Clicking the Delete button removes the selected calculated field.

Tip

Call one of the PivotCalculatedFieldCollection.Add method overloads to create a calculated field using the Spreadsheet API. Refer to the How to: Create a Calculated Field example for more details.

See Also