[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotField.Position

Position Property

Position

Gets or sets the position of the field among the fields in its current orientation.

The position determines the order of the field within its orientation area, such as row fields, column fields, page fields, or data fields.

Declaration
int Position { get; set; }
Property Position As Integer
Examples
worksheet.Range["A1:C4"].Value = new object[,] {
    {"Category", "Product", "Amount"},
    {"Fruit", "Apple", 100},
    {"Fruit", "Orange", 80},
    {"Snacks", "Cookie", 60}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "SalesPivot");
IPivotField field = pivotTable.PivotFields["Category"];
field.Orientation = PivotFieldOrientation.RowField;
field.Position = 0;
int position = field.Position;