Page 1 of 2

Export to PDF in Flex Mobile

Posted: Tue Jan 14, 2014 9:30 am
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) ?

Re: Export to PDF in Flex Mobile

Posted: Tue Jan 14, 2014 12:47 pm
by HighAley
Hello.

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

Thank you.

Re: Export to PDF in Flex Mobile

Posted: Tue Jan 14, 2014 1:30 pm
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.

Re: Export to PDF in Flex Mobile

Posted: Wed Jan 15, 2014 12:10 pm
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.

Re: Export to PDF in Flex Mobile

Posted: Wed Jan 15, 2014 6:19 pm
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.

Re: Export to PDF in Flex Mobile

Posted: Fri Jan 17, 2014 8:15 am
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.

Re: Export to PDF in Flex Mobile

Posted: Fri Jan 17, 2014 12:04 pm
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.

Re: Export to PDF in Flex Mobile

Posted: Mon Jan 20, 2014 7:39 am
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.

Re: Export to PDF in Flex Mobile

Posted: Mon Jan 20, 2014 11:34 pm
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.

Re: Export to PDF in Flex Mobile

Posted: Tue Jan 21, 2014 10:25 am
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.