Page 1 of 1

Export to several files

Posted: Sun Aug 15, 2021 3:58 pm
by jpgb
Is there a way of exporting a report to several files?

For example i have a report with a group by country. Could i have a export wich generated several files, one for each group?

thanks

Re: Export to several files

Posted: Mon Aug 16, 2021 8:38 am
by Andrew
Hello,

To do this automatically from the preview, sorry, there is no such functionality. But you can export from the code by specially preparing the template and adding some rows of code. If you need a sample, please let us know, we may prepare this.

Thank you.

Re: Export to several files

Posted: Wed Aug 18, 2021 5:36 pm
by jpgb
Yes, please. A sample would be great.

It would be insteresting to export a report to several files, assuming the report has one group (for example Client Orders Report - it has a group by Client Code) it generates one file for each different group (Client) with their Orders

Of course the report starts a new page on every new group

Thanks!
JB
Andrew wrote: Mon Aug 16, 2021 8:38 am Hello,

To do this automatically from the preview, sorry, there is no such functionality. But you can export from the code by specially preparing the template and adding some rows of code. If you need a sample, please let us know, we may prepare this.

Thank you.

Re: Export to several files

Posted: Fri Aug 20, 2021 9:11 pm
by Lech Kulikowski
Hello,

We need some additional time to prepare a sample for you.

Thank you.

Re: Export to several files

Posted: Mon Aug 23, 2021 12:14 am
by AcidSlide
Hi there,

My question is kinda similar. We want to export directly to different filetypes (ex: PDF, Excel, CSV (data)) without viewing the report and it contains input parameters from the user. We want to display first the input parameters (same in the Viewer/Preview) but instead of doing a render after submitting, directly export it to the different filetypes. Is this possible?

Thanks!

Re: Export to several files

Posted: Fri Aug 27, 2021 11:14 am
by Lech Kulikowski
Hello,

We need some additional time to prepare a sample for you.

Thank you.

Re: Export to several files

Posted: Sat Aug 28, 2021 2:34 am
by AcidSlide
Thank you Lech
Lech Kulikowski wrote: Fri Aug 27, 2021 11:14 am Hello,

We need some additional time to prepare a sample for you.

Thank you.

Re: Export to several files

Posted: Thu Sep 02, 2021 12:55 pm
by Lech Kulikowski
Hello,

You can use the following code:

Code: Select all

var report = new Stimulsoft.Report.StiReport();
report.loadFile("Reports/1.mrt");
var exportReport = new Stimulsoft.Report.StiReport();
exportReport.reportUnit = report1.reportUnit;
exportReport.render();
exportReport.renderedPages.clear();

report.renderAsync(function () {
    for (var index = 0; index < report.renderedPages.count; ++index) {
        exportReport.renderedPages.add(report.renderedPages.getByIndex(index));
		exportReport.exportDocument(Stimulsoft.Report.StiExportFormat.Pdf);
		// Export report to PDF format
		
		exportReport.renderedPages.clear();
    }
});
Thank you.

Re: Export to several files

Posted: Mon Sep 06, 2021 8:07 am
by AcidSlide
Lech Kulikowski wrote: Thu Sep 02, 2021 12:55 pm Hello,

You can use the following code:

Code: Select all

var report = new Stimulsoft.Report.StiReport();
report.loadFile("Reports/1.mrt");
var exportReport = new Stimulsoft.Report.StiReport();
exportReport.reportUnit = report1.reportUnit;
exportReport.render();
exportReport.renderedPages.clear();

report.renderAsync(function () {
    for (var index = 0; index < report.renderedPages.count; ++index) {
        exportReport.renderedPages.add(report.renderedPages.getByIndex(index));
		exportReport.exportDocument(Stimulsoft.Report.StiExportFormat.Pdf);
		// Export report to PDF format
		
		exportReport.renderedPages.clear();
    }
});
Thank you.

Thanks Lech! We will try this code snippet. We hope this is what we are looking for.

Re: Export to several files

Posted: Mon Sep 06, 2021 8:51 am
by Lech Kulikowski
Hello,

You are welcome.