Dynamic Sorting, Collapsing, and Drill-Down

The Angular Viewer component supports dynamic sorting, collapsing, and drill-down of reports. Dynamic sorting provides the ability to change the direction of sorting in a rendered report. To do this, click on the component that has the dynamic sorting enabled. Dynamic sorting is carried out in the following directions - Ascending and Descending. Each time the component is clicked, the sorting direction is reversed.

 

Multi-level sorting is allowed in the report. To do this, hold down the Ctrl key and sequentially click on the sorted components in the report. To reset sorting, you can click on any sorted component without holding down the Ctrl key.

 

 

 

A report with dynamic collapsing is an interactive report in which blocks can collapse/expand their content when you click on the block title. Report elements, which can be collapsed/expanded, are indicated by special icons - [-] or [+].

 

 

 

When using drill-down, under the main panel of the viewer, the drill-down panel with tabs for drill-down reports will be displayed. The currently displayed report will be highlighted.

 

 

 

To work with dynamic sorting, collapsing and drill-down reports, no additional viewer settings are required. To perform any actions before sorting, collapsing or drill-down of the report, a special Interaction action is used. It will be called when interactive action of the viewer.

 

HomeController.cs

...

public IActionResult InitViewer()

{

var requestParams = StiAngularViewer.GetRequestParams(this);

var options = new StiAngularViewerOptions();

options.Actions.ViewerEvent = "ViewerEvent";

options.Actions.Interaction = "ViewerInteraction";

 

return StiAngularViewer.ViewerDataResult(requestParams, options);

}

 

public IActionResult ViewerInteraction()

{

// Some code before any interaction

// ...

 

return StiAngularViewer.InteractionResult(this);

}

...

 

 

To get the type of action, you can use the parameters of the viewer. The viewer parameters are represented as an object of the StiRequestParams class, they are passed to any server side by any request, and contain all necessary information and states of the client part of the viewer. For each type of interactivity, the viewer has a certain type of action:

Sorting – when using column sorting;

DrillDown – when using drill-down in reports;

Collapsing – when using collapsing report blocks.

 

HomeController.cs

...

public IActionResult ViewerInteraction()

{

StiRequestParams requestParams = StiAngularViewer.GetRequestParams(this);

switch (requestParams.Action)

{

case StiAction.Sorting:

break;

 

case StiAction.DrillDown:

break;

 

case StiAction.Collapsing:

break;

}

 

return StiAngularViewer.InteractionResult(this);

}

...