EaxMdService.setFilter

Syntax

setFilter(report: PP.Exp.EaxDocument, filterMetadata: Object, callback: PP.Delegate);

Parameters

report. Express report document, data for which must be filtered.

filterMetadata. Filter data as a JSON object with the following fields: area - type of the filtered object, conditionType - condition type, elements - object elements that are filtered, enabled - indicates that the filter is active, keepParent - indicates that parents of hidden rows should not be shown, range - filter range, suppressEmpty - indicates that empty values must not be shown, suppressNoNumeric - indicates that zero values must not be shown, suppressZeros - indicates that non-numeric values must not be shown, useCondition - indicates that conditional filtering is used.

callback. Callback function.

Description

The setFilter method sets a filter for values of express report data.

Example

Executing the example requires that the HTML page contains the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component). By default the Filter by Table Values section in the Data tab of express report properties panel looks as follows:

Set filter by table rows that hides empty values:

// Get a service used to work with express report
var eaxMdService = expressBox.getService();
// Get express report document
var eaxAnalyzer = expressBox.getSource();
// Determine metadata for data filter
var filterMetadata = {
    area: "Table",
    conditionType: "None",
    elements: "Rows",
    enabled: True,
    keepParent: False,
    suppressEmpty: True,
    suppressNoNumeric: False,
    suppressZeros: False,
    useCondition: True
};
// Determine callback function arguments
var args = new PP.Mb.Ui.PropertyChangedEventArgs({   
    PropertyName: PP.Exp.Ui.ControlType.Filter,
    Metadata: filterMetadata,
    TypeUpdateData: [PP.Exp.Ui.ViewTypeUpdate.DataView, PP.Exp.Ui.ViewTypeUpdate.Ribbon]
});
// Determine callback function
var onPanelChanged = function (n, t) {        
    var chartView = expressBox.getDataView().getChartView();    
    t ? (chartView.DataChanged.fire(chartView, t.Args), t.Args.fireCallback(n, t)) : chartView.DataChanged.fire(chartView, t);
};
// Set filter by express report table values
eaxMdService.setFilter(eaxAnalyzer, filterMetadata, PP.Delegate(onPanelChanged, eaxMdService, args));
// Refresh properties panel
expressBox.getPropertyBarView().refreshAll();

After executing the example a filter that hides empty values is set for table rows:

See also:

EaxMdService