The designer raises events for the actions users perform — creating, previewing, saving and exiting a report.

Designer setup. Configure the designer, load the report template, process its callbacks, and connect the save action to the application.
// Configure the designer in full-screen mode
var options = new Stimulsoft.Designer.StiDesignerOptions();
options.appearance.fullScreenMode = true;

var designer = new Stimulsoft.Designer.StiDesigner(options, "StiDesigner", false);

// Persist the edited template
designer.onSaveReport = function (e) {
    var jsonStr = e.report.saveToJsonString();
    alert("Save to JSON string complete.");
};

// Pre-register data for every newly created report
designer.onCreateReport = function (e) {
    var ds = new Stimulsoft.System.Data.DataSet("Demo");
    ds.readJsonFile("../reports/Demo.json");
    e.report.regData("Demo", "Demo", ds);
    e.report.dictionary.synchronize();
};

designer.onPreviewReport = function (e) { };
designer.onExit = function (e) { };

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

designer.renderHtml("content");

Each event receives the current report through e.report. onSaveReport is where you persist the template (here serialized with saveToJsonString), and onCreateReport lets you pre-register data for every new report — giving you full control over the editing workflow.

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.