This example illustrates how to load and save the dashboard template to the MRT file. First of all, you should add Stimulsoft modules to the project. To do this, just use one universal package, all other dependencies will be loaded automatically:
// Stimulsoft Dashboard module
var Stimulsoft = require('stimulsoft-dashboards-js');
console.log("Stimulsoft Dashboards loaded");

Now you should create a new StiReport object with dashboard page. You can use the special createNewDashboard() constructor:
// Creating new dashboard
var report = Stimulsoft.Report.StiReport.createNewDashboard();
console.log("New dashboard created");

To load a previously prepared dashboard template, you can use the loadFile() method. As an argument, specify the path to the MRT template file:
// Loading dashboard template
report.loadFile("Dashboard.mrt");
console.log("Dashboard template loaded");

To save an existing dashboard template, you can use the saveFile() method. As with loading, in the arguments of the function, specify the path to the MRT template file:
// Save dashboard to file
report.saveFile("Dashboard2.mrt");
console.log("Rendered dashboard saved");

Auf dem Screenshot unten Sie können das Ergebnis des Beispiel-Codes ansehen:

Loading a Dashboard and Saving a Dashboard

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.