Using Viewer Events
Our sample projects and report templates can help you learn the basics of working with our products.The dashboard viewer notifies your application about what the user does — loading, exporting and more — through events handled in Angular, backed by this controller.
Initialize the viewer with event routing.
How it works. Viewer events flow to both the Angular component and this action, so your app can react to user actions on the client, the server, or both.
Initialize the viewer with event routing.
[HttpPost]
public IActionResult InitViewer()
{
var requestParams = StiAngularViewer.GetRequestParams(this);
var options = new StiAngularViewerOptions();
options.Actions.GetReport = "GetReport";
options.Actions.ViewerEvent = "ViewerEvent";
options.Appearance.ScrollbarsMode = true;
return StiAngularViewer.ViewerDataResult(requestParams, options);
}
public IActionResult ViewerEvent()
{
return StiAngularViewer.ViewerEventResult(this);
}Actions.ViewerEvent = "ViewerEvent"— routes viewer events to theViewerEventcontroller action.StiAngularViewer.ViewerEventResult(this)— processes each event on the server; the Angular side subscribes to them too.
How it works. Viewer events flow to both the Angular component and this action, so your app can react to user actions on the client, the server, or both.