PDF creation successfully but no data.

Stimulsoft Reports.JS discussion
Post Reply
User avatar
ednt
Posts: 64
Joined: Tue Apr 30, 2019 9:03 am

PDF creation successfully but no data.

Post by ednt »

Hi,
I try to create a .pdf from a stiReport.
Static things like background-color works but the data is not included/showing.
Any ideas?
Here my code:

Code: Select all

    const LoadReportFromString = (data) => {
    console.log(data);
    let report = new Stimulsoft.Report.StiReport();
    report.load(data);
    report.render();
    return report;
};


const SaveReportAsPdf = (report) => {
    console.log("Save Report: " + report.reportName);
    //console.log(report);
    // Create an PDF settings instance. You can change export settings.
    var settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
    // Create an PDF service instance.
    var service = new Stimulsoft.Report.Export.StiPdfExportService();

    // Create a MemoryStream object.
    var stream = new Stimulsoft.System.IO.MemoryStream();
    // Export PDF using MemoryStream.
    service.exportTo(report, stream, settings);

    // Get PDF data from MemoryStream object
    var data = stream.toArray();
    // Get report file name
    var fileName = String.isNullOrEmpty(report.reportAlias) ? report.reportName : report.reportAlias;
    // Save data to file
    Object.saveAs(Buffer.from(data), fileName + ".pdf", "application/pdf");
};
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: PDF creation successfully but no data.

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data which reproduces the issue for analysis.

Thank you.
User avatar
ednt
Posts: 64
Joined: Tue Apr 30, 2019 9:03 am

Re: PDF creation successfully but no data.

Post by ednt »

Thank you for your reply,

I create the test.mrt file with the Stimulsoft C# Designer.
Now I tried to create a .pdf from this file, but from js code.

In the First picture you can see how it should be, in the second you see the result as it is.

For a test I also created a mrt with the JS Designer. With this mrt it was possible to save it as html.
But it also failed to save it as pdf.
I have add the .mrt file as attachment for you, too.
Attachments
js_render_bug__shouldBe.PNG
js_render_bug__shouldBe.PNG (24.22 KiB) Viewed 12628 times
js_render_bug__Is.PNG
js_render_bug__Is.PNG (7.39 KiB) Viewed 12628 times
test.mrt
(191.05 KiB) Downloaded 141 times
User avatar
ednt
Posts: 64
Joined: Tue Apr 30, 2019 9:03 am

Re: PDF creation successfully but no data.

Post by ednt »

We need urgent help !!!

Please !
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: PDF creation successfully but no data.

Post by Lech Kulikowski »

Hello,

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

Thank you.
User avatar
ednt
Posts: 64
Joined: Tue Apr 30, 2019 9:03 am

Re: PDF creation successfully but no data.

Post by ednt »

Hello,
We still need help :(
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: PDF creation successfully but no data.

Post by Lech Kulikowski »

Hello,

Sorry for the delay with the response.

We couldn't reproduce the issue on our samples. Please send us a full sample project which reproduces the issue for analysis.

Also, you can check your report on our samples:
https://github.com/stimulsoft/Samples-JS

Thank you.
Post Reply