An Express server can host the Reports.JS viewer page and serve report templates from its own routes.

Build the viewer in the served page.
<script src="stimulsoft.reports.js"></script>
<script src="stimulsoft.viewer.js"></script>

<script>
    var options = new Stimulsoft.Viewer.StiViewerOptions();
    options.appearance.fullScreenMode = true;

    var viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
    viewer.renderHtml("viewer");

    var report = new Stimulsoft.Report.StiReport();
    report.loadFile('/report');   // served by an Express route
    viewer.report = report;
</script>

How it works. Express acts as the static and template host while the viewer runs in the browser, keeping the server role to routing and file delivery.

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