[]
This method is used for simultaneously setting layout options for all existing PivotFields.
void SetRowAxisLayout(LayoutRowType rowLayout)
Sub SetRowAxisLayout(rowLayout As LayoutRowType)
| Type | Name | Description |
|---|---|---|
| LayoutRowType | rowLayout | Specifies the type of layout row. |
worksheet.Range["A1:C5"].Value = new object[,] {
{"Category", "Product", "Amount"},
{"Beverages", "Tea", 100},
{"Beverages", "Coffee", 200},
{"Snacks", "Biscuits", 150}
};
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["Product"].Orientation = PivotFieldOrientation.RowField;
pivotTable.SetRowAxisLayout(LayoutRowType.TabularRow);