Search results

Member filtering

Member filtering allows you to view pivot table with particular records based on filter criteria. You can disable the member filter by setting the allowMemberFilter property to false. By default, this property is set as true.

Filtering through UI

Filtering can also be performed through UI option available in grouping bar and field list at run time.

Filtering through code

It can be configured using the filterSettings option through code-behind. The settings required to filter at initial rendering are:

  • name: It allows to set field name.
  • type: It allows to set filter type as either “Include” or “Exclude” to the field.
  • items: It allows to set the filter members of the field.
@Html.EJS().PivotView("PivotView").Height(300).DataSourceSettings(dataSource => dataSource.DataSource((IEnumerable<object>)ViewBag.DataSource).ExpandAll(false)
.FilterSettings(filtersettings =>
}).Rows(rows =>
    rows.Name("Country").Add(); rows.Name("Products").Add();
}).Columns(columns =>
    columns.Name("Year").Caption("Year").Add(); columns.Name("Quarter").Add();
}).Values(values =>
    values.Name("Sold").Caption("Units Sold").Add(); values.Name("Amount").Caption("Sold Amount").Add();
public ActionResult Index()
    var data = GetPivotData();
    ViewBag.DataSource = data;
    ViewBag.filterMembers = new string[] { "FY 2017" };
    return View();

See Also