[]
Represents a collection of lines on the row or column axis of a PivotTable report.
Each IPivotLine in this collection corresponds to a row or column line in the PivotTable report and contains a set of PivotCells. Use this interface to access the lines returned by PivotLines and to enumerate or retrieve individual pivot lines by position.
public interface IPivotLines : IEnumerable<IPivotLine>, IEnumerable
Public Interface IPivotLines
Inherits IEnumerable(Of IPivotLine), IEnumerable
worksheet.Range["A1:C5"].Value = new object[,] {
{"Category", "Product", "Amount"},
{"Fruit", "Apple", 100},
{"Fruit", "Orange", 200},
{"Drink", "Tea", 150},
{"Drink", "Coffee", 120}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C5"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "SalesPivot");
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
IPivotLines pivotLines = pivotTable.PivotRowAxis.PivotLines;
IPivotLine firstLine = pivotLines[0];
| Name | Description |
|---|---|
| Count | 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. |
| this[int] | Gets the IPivotLine at the specified position in this collection. Use this property to retrieve a row-axis or column-axis pivot line by its zero-based index from the collection returned by PivotLines. |