Cloud
Облачный сервис для быстрого и эффективного анализа и визуализации данных для вашего бизнеса без необходимости создания своих приложений и программирования.
@event directive and pass your own handler functions:<script setup lang="ts">
import { StimulsoftViewer } from 'stimulsoft-viewer-vue';
function loaded(): void {
console.log('Report loaded');
}
function onExport(event: any): void {
console.log(`Export to: ${event.format}`);
}
</script>
<template>
<StimulsoftViewer
request-url="/Viewer/{action}"
action="InitViewer"
height="100vh"
@loaded="loaded"
@export="onExport"
/>
</template>@loaded fires once the report has been rendered and is ready, and @export fires when the user exports the report — the event object carries details such as the target format. The same pattern works for other viewer events (printing, interaction, e-mail, and more); simply add the corresponding @... handler.ViewerEvent action, registered in the options during initialization:public IActionResult InitViewer()
{
var requestParams = StiVueViewer.GetRequestParams(this);
var options = new StiVueViewerOptions();
options.Actions.GetReport = "GetReport";
options.Actions.ViewerEvent = "ViewerEvent";
return StiVueViewer.ViewerDataResult(requestParams, options);
}
[HttpPost]
public IActionResult ViewerEvent()
{
return StiVueViewer.ViewerEventResult(this);
}StiVueViewer.ViewerEventResult helper processes the incoming event and returns the result the viewer expects, so server-side actions such as export and print work out of the box.