[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotField.LayoutForm

LayoutForm Property

LayoutForm

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.

Declaration
LayoutFormType LayoutForm { get; set; }
Property LayoutForm As LayoutFormType
Examples
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;