The following example demonstrates how to set master filter in the Dashboard Viewer control.
The Dashboard Viewer control loads a dashboard with two master filter items - the Grid and Range Filter dashboard items. The Chart item displays the filtered data.
The DashboardViewer.ConfigureDataConnection event is handled to specify the Extract Data Source filename. The DashboardViewer.CustomizeDashboardTitle event handler creates the command button that executes the application's SetMasterFilterMethod procedure.
The SetMasterFilterMethod procedure uses the DashboardViewer.SetMasterFilter method to select the rows in the Grid dashboard item. The DashboardViewer.SetRange method selects the range in the Range Filter dashboard item.
This example also demonstrates how to handle the DashboardViewer.MasterFilterSet and DashboardViewer.MasterFilterCleared events.
To reduce the application loading time and memory usage, initialize master filters before loading data as illustrated in the How to apply default filtering to master filters in Dashboard Viewer example.