[]
Gets or sets the way the specified PivotTable items appear.
Use this property to determine whether the field is displayed in table format or outline format.
LayoutFormType LayoutForm { get; set; }
Property LayoutForm As LayoutFormType
worksheet.Range["A1:B4"].Value = new object[,] {
{"Category", "Amount"},
{"Beverages", 100},
{"Beverages", 200},
{"Snacks", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "SalesPivot");
IPivotField field = pivotTable.PivotFields["Category"];
field.Orientation = PivotFieldOrientation.RowField;
field.LayoutForm = LayoutFormType.Outline;
LayoutFormType layoutForm = field.LayoutForm;