When a dashboard loads data from a protected JSON endpoint, authentication headers can be attached in the onBeginProcessData event.

Add custom headers before the data request.
var report = Stimulsoft.Report.StiReport.createNewDashboard();

report.onBeginProcessData = function (args) {
    if (args.database === "JSON" && args.command === "GetData" &&
        args.pathData && args.pathData.indexOf("/dashboard/ProtectedDemo.json") >= 0) {
        args.headers.push({ key: "X-Auth-Token", value: "*YOUR TOKEN*" });
    }
};

report.loadFile("../dashboard/DBSsimp.mrt");
viewer.report = report;

How it works. The engine applies the headers to its data request, so the dashboard can read endpoints behind token or session protection.

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.