[]
Removes the calculated fields by name.
Use this method to delete a calculated field from the calculated field collection of a PivotTable.
void Remove(string fieldName)
Sub Remove(fieldName As String)
| Type | Name | Description |
|---|---|---|
| string | fieldName | The name of the calculated field to remove. |
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");