I am doing some experiment with this sample https://www.stimulsoft.com/en/samples/j ... ort-to-pdf
i found that you can't export report with image using this method, new pdf will be created but if there are image in that report, the image will be empty,
however you can export correctly using viewer toolbar
attached are the sample report, pdf created using sample method, and pdf created using viewer toolbar export to pdf
we want to export report to pdf via custom button but a lot of our report include one or more image
Export to PDF using toolbar and code
Export to PDF using toolbar and code
- Attachments
-
- report_toolbar.pdf
- (17.46 KiB) Downloaded 246 times
-
- report_direct.pdf
- (12.25 KiB) Downloaded 311 times
-
- test.mrt
- (8.18 KiB) Downloaded 215 times
Re: Export to PDF using toolbar and code
Hello,
Thank you for the sample.
We have found some issues. We need some time to fix the issue. We will let you know about the result.
Thank you.
Thank you for the sample.
We have found some issues. We need some time to fix the issue. We will let you know about the result.
Thank you.
Re: Export to PDF using toolbar and code
Hello,
Please try to use the following code:
Thank you.
Please try to use the following code:
Code: Select all
var report = new Stimulsoft.Report.StiReport();
report.loadFile("reports/test.mrt");
report.render();
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.exportToAsync(function () {
var data = stream.toArray();
// Get report file name
var fileName = String.isNullOrEmpty(report.reportAlias) ? report.reportName : report.reportAlias;
// Save data to file
Object.saveAs(data, fileName + ".pdf", "application/pdf");
}, report, stream, settings);