[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.PivotFilterOptions.AppliedDataField

AppliedDataField Property

AppliedDataField

Gets or sets the value filter setting.

Specifies which DataField the current field is filtered by. The returned value represents the index of the referenced DataField in the DataFields collection.

Declaration
public int AppliedDataField { get; set; }
Public Property AppliedDataField As Integer
Examples
worksheet.Range["A1:B5"].Value = new object[,] {
    {"Product", "Amount"},
    {"Example Speaker", 4270},
    {"Example Camera", 8239},
    {"Example TV", 2626},
    {"Example Smartphone", 8250}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B5"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "SalesPivot");
IPivotField productField = pivotTable.PivotFields["Product"];
productField.Orientation = PivotFieldOrientation.RowField;
IPivotField amountField = pivotTable.PivotFields["Amount"];
amountField.Orientation = PivotFieldOrientation.DataField;
PivotFilterOptions options = new PivotFilterOptions();
options.AppliedDataField = 0;
IPivotFilter filter = productField.PivotFilters.Add(PivotFilterType.ValueGreaterThan, 7000, null, options);
IPivotField dataField = filter.DataField;