[]
Gets the number of items in the PivotLines collection.
This collection contains the row or column pivot lines associated with a pivot axis, such as the collection returned by PivotLines.
int Count { get; }
ReadOnly Property Count As Integer
object[,] sourceData = new object[,] {
{"Product", "Category", "Amount"},
{"Apple", "Fruit", 100},
{"Pear", "Fruit", 80},
{"Desk", "Office", 120}
};
worksheet.Range["A1:C4"].Value = sourceData;
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "SalesPivot");
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
int count = pivotTable.PivotRowAxis.PivotLines.Count;