[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ICalculatedFields.Remove

Remove Method

Remove(string)

Removes the calculated fields by name.

Use this method to delete a calculated field from the calculated field collection of a PivotTable.

Declaration
void Remove(string fieldName)
Sub Remove(fieldName As String)
Parameters
Type Name Description
string fieldName

The name of the calculated field to remove.

Examples
worksheet.Range["A1:B3"].Value = new object[,] {
    {"Product", "Amount"},
    {"Apple", 100},
    {"Orange", 200}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B3"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "pivotTable1");
pivotTable.CalculatedFields.Add("Tax", "=Amount*0.1");
pivotTable.CalculatedFields.Remove("Tax");