[]
Gets the collection of pivot cells in this pivot line.
Use this property to access the IPivotCell objects that belong to the current row or column line in a PivotTable axis.
IPivotLineCells PivotLineCells { get; }
ReadOnly Property PivotLineCells As IPivotLineCells
object[,] sourceData = {
{"Product", "Category", "Amount"},
{"Bose 785593-0050", "Consumer Electronics", 4270},
{"Iphone XR", "Mobile", 9062}
};
worksheet.Range["G1:I3"].Value = sourceData;
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["G1:I3"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["A1"], "SalesPivot");
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
IPivotLine pivotLine = pivotTable.PivotRowAxis.PivotLines[0];
IPivotLineCells pivotLineCells = pivotLine.PivotLineCells;