Using Designer Events
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.The designer raises events for creating, saving and previewing a report. This example registers data on new reports and reacts to saves.
Designer setup. Configure the designer, load the report template, process its callbacks, and connect the save action to the application.
Designer setup. Configure the designer, load the report template, process its callbacks, and connect the save action to the application.
<script setup lang="ts">
import { Designer, Stimulsoft } from 'stimulsoft-reports-js-vuejs/designer';
function onCreateReport(args: Stimulsoft.Designer.CreateReportArgs) {
var dataSet = new Stimulsoft.System.Data.DataSet("Demo");
dataSet.readJsonFile("Data/Demo.json");
args.report.regData("Demo", "Demo", dataSet);
args.report.dictionary.synchronize();
}
function onSaveReport(args: Stimulsoft.Designer.SaveReportArgs) { alert("onSaveReport event"); }
var report = new Stimulsoft.Report.StiReport();
report.loadFile("Reports/SimpleList.mrt");
var designerOptions = new Stimulsoft.Designer.StiDesignerOptions();
</script>
<template>
<Designer :report="report" :options="designerOptions"
@create-report="onCreateReport" @save-report="onSaveReport" />
</template>Each event receives the current report through args.report; onCreateReport pre-registers data for new reports, and onSaveReport is where you persist the edited template.