[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotField.Orientation

Orientation Property

Orientation

Gets or sets the location of the field in the specified PivotTable report.

Use this property to determine whether the field is currently placed in the row, column, page, data, or hidden area of the PivotTable.

Declaration
PivotFieldOrientation Orientation { get; set; }
Property Orientation As PivotFieldOrientation
Examples
object[,] sourceData = new object[,] {
    {"Product", "Category", "Amount"},
    {"Apple", "Fruit", 100},
    {"Pear", "Fruit", 200}
};
worksheet.Range["A1:C3"].Value = sourceData;
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C3"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "pivotTable1");
IPivotField field = pivotTable.PivotFields["Category"];
field.Orientation = PivotFieldOrientation.RowField;
PivotFieldOrientation orientation = field.Orientation;