Express > Express Assembly Interfaces > IEaxGrid > IEaxGrid.ApplySelectionToFilterRange
ApplySelectionToFilterRange(Range: IPivotFilterRange);
Range. Table area.
The ApplySelectionToFilterRange method passes parameters of table area as the range, in which data is filtered.
To set selected table area, use ITabSheet.Cells and ITabSelection.AddRange.
Executing the example requires that the repository contains an express report with the EXPRESS_REPORT identifier that contains a table.
Add links to the Express, Metabase, Pivot and Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Express: IEaxAnalyzer;
Pivot: IPivot;
Grid: IEaxGrid;
Filter: IPivotFilter;
Range: IPivotFilterRange;
TabRange: ITabRange;
Selection: ITabSelection;
TabView: ITabView;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get express report
Express := MB.ItemById("EXPRESS_REPORT").Edit As IEaxAnalyzer;
// Get table data display settings
Pivot := Express.Pivot;
// Get filtering parameters
Filter := Pivot.Filter;
// Set filtering condition - greater than number
Filter.ConditionType := PivotFilterType.GA;
// Set number
Filter.ConditionValueA := 15;
// Set filtering by rows
Filter.Elements := PivotFilterElements.Rows;
// Get filtering range
Range := Filter.Range;
// Get report data table
Grid := Express.Grid;
// Set selected area range
TabRange := Grid.TabSheet.Cells(1, 1, 5, 5);
// Get spreadsheet view
TabView := Grid.TabSheet.View;
// Get the current table selection
Selection := TabView.Selection;
// Add a range to table selection
Selection.AddRange(TabRange);
// Send table selection to filtering range
Grid.ApplySelectionToFilterRange(Range);
// Set the area, for which filtering is applied
Filter.Area := PivotFilterArea.Range;
// Apply filtering to data table
Filter.UseCondition := True;
// Save changes
(Express As IMetabaseObject).Save;
End Sub UserProc;
After executing the example, data filtering in specified range of selected table area will be executed. Data will be filtered by rows were value is bigger than 15.
See also: