[]
Gets or sets whether this PivotField uses compact row layout when it is placed in the row area.
When this property is true, items from multiple row PivotFields can be displayed in a single column.
bool LayoutCompactRow { get; set; }
Property LayoutCompactRow As Boolean
worksheet.Range["A1:C5"].Value = new object[,] {
{"Category", "Product", "Amount"},
{"Fruit", "Apple", 100},
{"Fruit", "Orange", 80},
{"Vegetables", "Carrot", 60},
{"Vegetables", "Celery", 40}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C5"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"]);
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
IPivotField field = pivotTable.PivotFields["Product"];
field.Orientation = PivotFieldOrientation.RowField;
field.LayoutCompactRow = true;
bool compactRow = field.LayoutCompactRow;