Export from code to PDF

Stimulsoft Reports.PHP discussion
Post Reply
Francine
Posts: 28
Joined: Wed May 13, 2015 10:56 pm

Export from code to PDF

Post 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.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Export from code to PDF

Post 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.
Francine
Posts: 28
Joined: Wed May 13, 2015 10:56 pm

Re: Export from code to PDF

Post 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?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Export from code to PDF

Post 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.
Francine
Posts: 28
Joined: Wed May 13, 2015 10:56 pm

Re: Export from code to PDF

Post by Francine »

Thank you for your quick replies. I will email you my report.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Export from code to PDF

Post by Alex K. »

Hello

Let us know if you need any additional help.

Thank you.
Post Reply