Page 1 of 1

Export from code to PDF

Posted: Mon Sep 19, 2016 4:13 pm
by Francine
I need to export the report to PDF from the code. I saw some other posts about it but it does not seem to apply to the php type of code I am using.
I am using the PHP version based on Flash demo sample code.

Re: Export from code to PDF

Posted: Tue Sep 20, 2016 11:03 am
by HighAley
Hello.

In the Flex report engine It's possible to export reports with an ExportsFx AIR utility.

This utility allows to export or print a report without using the viewer. You can use the following command line parameters:

report_file - report file path and name (mrt, mrz, mrx, mdc, mdz, mdx)
report_password - password for mrx or mdx report file
report_print - report print option (dialog, direct)
export_file - exported file path and name
export_format - export format (pdf, excel, text, rtf, html)

Windows command:

Code: Select all

ExportsFx.exe report_file="d:\MyReport.mrt" export_format="pdf" export_file="d:\MyReport.pdf"
or

Code: Select all

ExportsFx.exe report_file="d:\MyReport.mrt" report_print="direct"
Linux command:

Code: Select all

/opt/ExportsFx/bin/ExportsFx report_file=/home/username/test/Report.mrt export_file=/home/username/test/Report.pdf export_format=pdf
This utility needs the Adobe AIR Framework to be installed.

You could find this utility in the official release.

Thank you.

Re: Export from code to PDF

Posted: Tue Sep 20, 2016 11:22 pm
by Francine
If I understand properly an exe will have to be installed on the client computer. This will not work for us because a lot of our users would not understand how to install Flash player and will be afraid to do so. And most of our users already have a PDF viewer already installed on their computer. We need to display a PDf file to our users instead of the report viewer.

I have tried one of your example to create PDF file with JS and it was working fine with your simple.mrt file. But when I try it with our report, it is blank. In our report we use some MySQL connections and some parameters. Is it possible to do it with JS for our report?

Re: Export from code to PDF

Posted: Wed Sep 21, 2016 11:22 am
by HighAley
Hello.

You wrote that you use Flash components. So the solution was for Flash component.

For JS components it's possible to export the report without ExportsFx utility.

If you have any problem with exporting your reports, please, send us your report template with sample data to support@stimulsoft.com.

Thank you.

Re: Export from code to PDF

Posted: Wed Sep 21, 2016 3:38 pm
by Francine
Thank you for your quick replies. I will email you my report.

Re: Export from code to PDF

Posted: Wed Sep 21, 2016 8:23 pm
by Alex K.
Hello

Let us know if you need any additional help.

Thank you.