[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotFilter.PivotField

PivotField Property

PivotField

Gets the label field that the pivot filter depends on.

Declaration
IPivotField PivotField { get; }
ReadOnly Property PivotField As IPivotField
Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Product", "Amount"},
    {"Apple", 120},
    {"Banana", 90},
    {"Apricot", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "SalesPivot");
IPivotField productField = pivotTable.PivotFields["Product"];
productField.Orientation = PivotFieldOrientation.RowField;
IPivotFilter filter = productField.PivotFilters.Add(PivotFilterType.CaptionBeginsWith, "A");
IPivotField field = filter.PivotField;