Export to PDF in Flex Mobile

Stimulsoft Reports.Flex discussion
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Export to PDF in Flex Mobile

Post by hugo »

Your viewer was designed for desktops however I would like to export to PDF in a Flex Mobile (even the user couldn't preview the report in a report viewer).

I tryed that that but when I runned the initialize method I get an error about mx Canvas. Seems that your engine is stucked in Flex 3. How can I export to PDF in a Flex Mobile (even without a viewer) ?
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Export to PDF in Flex Mobile

Post by HighAley »

Hello.

Could you describe more detailed what do you mean under Flex Mobile?
Our product use Flex SDK 4.5.

Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Export to PDF in Flex Mobile

Post by hugo »

Just a project of type Flex Mobile using AIR Mobile with Apache Flex 4.11.
If you speak with the responsible for Flex area he/she will know what I mean.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Export to PDF in Flex Mobile

Post by HighAley »

Hello.

Thank you for this information.
We are working in direction of HTML5 Viewers and Designer but it's impossible to create such components for Reports.Fx for Flex.

Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Export to PDF in Flex Mobile

Post by hugo »

Hello,

Yes but the engine is already there and it's Flex. Seems a minor incompatibility from the old mx Canvas instead of Spark Group that seems that you are using in your engine independent of Flex 4.5 or not.

One thing is a report viewer made to Flex Mobile (touch) and another it's a incompatibility that is breaking for exporting to PDF. This should be supported also for Flex Mobile (that is Flex without the old Canvas mx).


Thank you.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Export to PDF in Flex Mobile

Post by Vladimir »

Hello,

Unfortunately, we have not tested our product with the Flex SDK 4.11, and currently we have no plans to create a separate version using the specified SDK.

Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Export to PDF in Flex Mobile

Post by hugo »

This is nothing to do with Flex 4.11. Currently I'm using your product sucessfull with Flex 4.11 for Desktop app.

I'm talking about Flex Mobile for AIR Mobile available since Flex 4.5.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Export to PDF in Flex Mobile

Post by Vladimir »

Hello,

Please try to use the following code:

Code: Select all

				// Create new report object
				var report: StiReport = new StiReport();

				// Load document from XML string
				report.loadDocumentFromString(documentString);

				// Create a new PDF export service
				var service: StiPdfExportService = new StiPdfExportService();

				// Create a new PDF export settings
				var settings: StiPdfExportSettings = new StiPdfExportSettings();

				// Create a buffer for report exporting
				var buffer: ByteArray = new ByteArray();

				// Export report to ByteArray
				service.exportPdf(report, buffer, settings);
For export, you have no need to call StiViewerFx.initialize() or StiDesignerFx.initialize() methods, they are necessary for the viewer and the designer.

Thank you.
hugo
Posts: 359
Joined: Fri Mar 08, 2013 10:46 am

Re: Export to PDF in Flex Mobile

Post by hugo »

Hello,

Thank you for your reply.
As soon I run the first line of code in a Flex Mobile project I get the mx Canvas error.

The solution is to upgrade from mx Canvas to Spark Group (it's a suggestion for a future version).


Regards,
Hugo.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Export to PDF in Flex Mobile

Post by Vladimir »

Hello,

Thanks for the information.
Unfortunately, currently we have no plans to upgrade from mx Canvas to Spark components. Perhaps we will work on this in the future.

Thank you.
Locked