Issue after upgrading to version 2025.4.2 – Empty PDF report when loading XML data

Stimulsoft Reports.JS discussion
Post Reply
manuel.leonor
Posts: 3
Joined: Tue Aug 22, 2023 10:19 pm

Issue after upgrading to version 2025.4.2 – Empty PDF report when loading XML data

Post by manuel.leonor »

Hi team,

I’m currently updating my Stimulsoft environment to the latest version 2025.4.2.
My previous project version was 2023.1.5, and after upgrading, the report generation stopped working.

I have a function that generates a PDF report using XML data, but now the generated report appears completely empty.

Here’s my current code:

Code: Select all

const DownloadReport = async () => {
  const Stimulsoft = window.Stimulsoft
  const report = new Stimulsoft.Report.StiReport();

  const xmlData = await fetch(XML).then(res => res.text());
  const template = await fetch(REPORT_STI).then(res => res.text());

  report.load(template);

  // Load XML data
  const blob = new Blob([xmlData], { type: 'text/xml' });
  const url = URL.createObjectURL(blob);
  const dbCFDi = report.dictionary.databases.getByName("CFDi");
  dbCFDi.pathSchema = "";
  dbCFDi.pathData = url;

  // Report variables
  let variable = report.dictionary.variables.getByName('OriginalString');
  if (variable)
    variable.value = "ORIGINAL STRING EXAMPLE";

  variable = report.dictionary.variables.getByName('OriginalStringSAT');
  if (variable)
    variable.value = "ORIGINAL STRING SAT EXAMPLE";

  report.renderAsync(() => {
    // Export report to PDF
    report.exportDocumentAsync((pdfData) => {
      const fileName = `REPORTE.pdf`;
      Stimulsoft.System.StiObject.saveAs(pdfData, fileName, 'application/pdf');
    }, Stimulsoft.Report.StiExportFormat.Pdf);
  });
};

I’m sending this example using Vite, just to illustrate the issue.
Both the XML and the report template (.mrt) are fetched from APIs, not local files.

I’ve already checked the official documentation and tried several approaches, but haven’t been able to solve the problem.
It seems that some of the functions or data-loading methods might be deprecated or changed in the latest version.

Could you please help me identify what’s changed or how I should correctly load XML data in version 2025.4.2?

Thank you in advance for your help!

Best regards,
Manuel Leonor

download/file.php?mode=view&id=31005
Attachments
Captura de pantalla 2025-10-31 195058.png
Captura de pantalla 2025-10-31 195058.png (140.42 KiB) Viewed 234 times
stireport-xml.zip
(9.9 MiB) Downloaded 7 times
Max Shamanov
Posts: 1039
Joined: Tue Sep 07, 2021 10:11 am

Re: Issue after upgrading to version 2025.4.2 – Empty PDF report when loading XML data

Post by Max Shamanov »

Hello,

We need some additional time to investigate the issue, we will let you know about the result as soon as possible.

Thank you.
#18710
Post Reply