On Node.js, authentication headers can be attached while a dashboard reads data from a protected JSON endpoint, via onBeginProcessData.

Add headers, then render and export.
var report = Stimulsoft.Report.StiReport.createNewDashboard();

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

report.loadFile("DBSsimp.mrt");
report.exportDocumentAsync(function (pdfData) {
    require('fs').writeFileSync('./Dashboard.pdf', Buffer.from(pdfData));
}, Stimulsoft.Report.StiExportFormat.Pdf);

How it works. The engine sends the headers with its JSON fetch, so a server-side export can read protected endpoints.
Auf dem Screenshot unten Sie können das Ergebnis des Beispiel-Codes ansehen:

Supply Custom Headers for Json Database

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.