[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.PivotFilterOptions

PivotFilterOptions Class

Represents optional settings for a pivot filter.

Use this class to provide additional configuration when adding a pivot filter with Add(PivotFilterType, object, object, PivotFilterOptions). It contains settings used by value filters, date filters, and Top 10 filters, such as the filter name, description, referenced data field, whole-day date matching, and top-or-bottom selection behavior.

Inheritance
PivotFilterOptions
Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public class PivotFilterOptions
Public Class PivotFilterOptions
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;

Constructors

Name Description
PivotFilterOptions()

Properties

Name Description
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.

Description

Gets or sets a brief description of the filter.

IsTop10Type

Gets or sets the selection direction for a Top 10 pivot filter.

Returns true when the filter is configured to select the top n items, and false when it is configured to select the bottom n items. The default value is true.

Name

Gets or sets the name of the filter.

Returns the name assigned to this PivotFilterOptions instance.

WholeDayFilter

Gets or sets a value indicating whether the date filter should use whole days in its filtering criteria.

This option is used with Add(PivotFilterType, object, object, PivotFilterOptions) when creating a date filter and determining whether the filter criteria should match by whole day instead of by time.