Set up the report viewer in Vue 3, load a template, and connect the component to the application.

Viewer setup. Configure the viewer, load the report, assign it to the component, and process the requests or events raised by the UI.
<script setup lang="ts">
import { Viewer, Stimulsoft } from 'stimulsoft-reports-js-vuejs/viewer';

function onEmailReport(args: Stimulsoft.Viewer.EmailReportArgs) {
    alert(`Email: ${args.settings.email} File name: ${args.fileName}`);
}

var report = new Stimulsoft.Report.StiReport();
report.loadFile("Reports/SimpleList.mrt");

var viewerOptions = new Stimulsoft.Viewer.StiViewerOptions();
viewerOptions.toolbar.showSendEmailButton = true;
</script>

<template>
    <Viewer :report="report" :options="viewerOptions" @email-report="onEmailReport" />
</template>
Events are bound with Angular's (event) syntax or Vue's @event directive; here the handler receives the e-mail settings and file name. The same pattern covers print, export and design events.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.