[]
Returns the number of calculated fields.
This property returns the number of calculated fields in the collection returned by CalculatedFields for a PivotTable report.
int Count { get; }
ReadOnly Property Count As Integer
object[,] sourceData = {
{"Product", "Amount"},
{"Apple", 100},
{"Pear", 200}
};
worksheet.Range["A1:B3"].Value = sourceData;
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");
int count = pivotTable.CalculatedFields.Count;