FlexCel 6 and Working with files in iOS


Tuesday, May 28, 2013

Introducing FlexCel 6

As you might have noticed, we've just released FlexCel 6 for Delphi with iOS support (FlexCel 6 for .NET is coming soon now and it will also have iOS support). We've taken our time to release it because we didn't want this to be a "kind of works in iOS" release, but to be a fully working, usable solution to deal with xls, xlsx, pdf and html files in iOS.

And I think we've gotten it right. FlexCel 6 can smoothly generate xls, xlsx, native pdf and html files, open xls and xlsx files, print and preview xls and xlsx, and all in iOS. To get the maximum performance and compatibility, the xls/x viewer uses direct CoreGraphics calls in iOS or OSX instead of FireMonkey canvas calls to render the files, in a way that they can show in your phone as they show in a desktop machine. All the page is rendered to an off-screen buffer, which is then shown in the completely FireMonkey-native and styleable TFlexCelPreviewer control. You get the best of both worlds: You have a native FireMonkey control that can interoperate nicely with the rest of the FireMonkey controls in your form, and can be styled as any other FireMonkey control, but under the hood, the control is doing native calls to iOS for rendering to get the best results.

And this isn't a cut-out version, almost everything you can do in your desktop machine you can do it on your phone. The only thing that you can't do in iOS is to read or write encrypted xlsx files, because adding crypto support would require that you declare crypto routines when submitting to the app store, and you would need to comply with all the export regulations. So by the moment we are leaving encryption out, but virtually everything else is in. (Encryption might come later as an optional, use-it-at-your-own-risk, addin). Of course there are limitations with respect to the Desktop version; in a phone you have less memory, a less capable CPU, and everything will go slower. But it works and works quite well. (We've spent also a lot of time optimizing memory usage in FlexCel 6, so it works better in phones, but also works better in your desktop machine).

Working with files in iOS

As explained above, if we don't count encryption and the slower cpu/less memory, FlexCel for iOS is virtually identical to FlexCel for Windows. It is the same code, the same calls, everything, and this makes porting simple. But there is a big difference: Working with files.
In iOS you can't read or write files outside the folder where your application is. Which makes the system much more secure (now this little game that you downloaded can't read all your mail and documents and send them to some server overseas), but on the other hand, makes it much more difficult to interoperate and share files between apps.

For FlexCel 6 we were not happy to just give you a library to read and write xls/x files, and so we've spent a lot of time investigating how to make the workflow simpler, how to workaround the bugs currently in XE4, and how to make your app interop with the others. So you can read an xls file from DropBox, modify it, and send it back to DropBox. Or email it.

And I think all the information we collected might be very useful not only for FlexCel users, but for everybody who needs to deal with files in iOS and Delphi.
So I will write a link to the two documents explaining how to deal with files in iOS here. Those two documents also come as expected when you install FlexCel: trial or registered.

1)Using FlexCel with iOS.
This is a conceptual document, and explains how to import and export the files from Delphi. Once again, while it is targeted to FlexCel users, most of the content applies even if you are not a FlexCel user.

2)FlexView tutorial
This is a step-by-step tutorial showing how to start with an empty application and make it interoperate with the other apps in your phone. The full source code for the app created in the tutorial is available in the FlexCel trial or registered distributions.

Bonus track: Video of FlexCel 6 working in an iPhone

While FlexCel is focused mostly in the non visual stuff, here is an small example of how the FlexView application in the tutorial above works in an actual device:
FlexCel 6 working on an iPhone:

FlexCel 6 working on an iPad(*):

(*)Note: In the iPad example we are showing a chart. Currently, charts are rendered in xls, but not in xlsx.

Adrian Gallero


This blog post has not received any comments yet.

Add a new comment:
  You will receive a confirmation mail with a link to validate your comment, so please use a valid email address.
Change Image
Fill in the characters from the image above:

All fields are required.

Previous  |  Next  |  Index