[]
Specifies the type of a pivot line represented by IPivotLine in a PivotTable.
Use this enumeration with LineType to determine whether that pivot line is a regular item line, a subtotal line, a grand total line, or a blank separator line.
public enum PivotLineType
Public Enum PivotLineType
worksheet.Range["A1:B4"].Value = new object[,] {
{"Category", "Amount"},
{"Fruit", 100},
{"Fruit", 200},
{"Vegetable", 50}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IWorksheet pivotSheet = workbook.Worksheets.Add();
IPivotTable pivotTable = pivotSheet.PivotTables.Add(pivotCache, pivotSheet.Range["A1"], "SalesPivot");
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Amount"].Orientation = PivotFieldOrientation.DataField;
pivotTable.Update();
IPivotLine line = pivotTable.PivotRowAxis.PivotLines[0];
if (line.LineType == PivotLineType.Regular)
{
IPivotLineCells cells = line.PivotLineCells;
}
| Name | Description |
|---|---|
| Blank | A blank pivot line that is inserted after each group. |
| GrandTotal | A pivot line that displays grand total values. |
| Regular | A regular pivot line that contains pivot items. |
| Subtotal | A pivot line that displays subtotal values for a group. |