The previous version that the project had was 2023.1.5, when we updated to the latest version it no longer worked
I have a function to generate a pdf report with xml but when the report is generated it comes out empty.
Code: Select all
const base64ToString = Buffer.from(data.Template, "base64").toString();
const Stimulsoft = window.Stimulsoft;
Stimulsoft.Base.StiLicense.key = ReportingAuthCode
// Creating a new report object
const report = Stimulsoft.Report.StiReport.createNewReport();
// Loading a report template (MRT) into the report object
report.load(base64ToString);
// Carga del xml
const blob = new Blob([data.XML], { type: 'text/xml' });
const url = URL.createObjectURL(blob);
const dbCFDi = report.dictionary.databases.getByName("CFDi");
dbCFDi.pathSchema = "";
dbCFDi.pathData = url;
// Variables del reporte
let variable = report.dictionary.variables.getByName('OriginalString');
if (variable)
variable.value = data.OriginalString;
variable = report.dictionary.variables.getByName('OriginalStringSAT');
if (variable)
variable.value = data.OriginalStringSAT;
report.renderAsync(() => {
// Exporting the report to PDF
report.exportDocumentAsync((pdfData) => {
const fileName = `${data.StampUUID.toUpperCase()}.pdf`
window.Stimulsoft.System.StiObject.saveAs(pdfData, fileName, 'application/pdf');
}, window.Stimulsoft.Report.StiExportFormat.Pdf);
});