How to export a datagrid to Excel file in Flex?

Angeline picture Angeline · Nov 2, 2009 · Viewed 26.8k times · Source

How do I export data in my datagrid to an Excel file in Flex?

Can anyone provide some examples for that? I am browsing but couldn't find out a single example of that kind.

EDIT

Browsed a lot and found out how to convert datagrid data to csv format. Now How to convert that to excel? Is there a way to do that without using any server script ? Can't it be done in Flex alone?

Answer

Andy Li picture Andy Li · Nov 2, 2009

There is as3xls for you to write xls file. It only support a single sheet(but I think that's fine).

But I think using csv or html as stated by @susichan and @Rafal Ziolkowski will be more simple if you do not need to use excel functions (like cell formula).

Oh, and there is csvlib for writing csv. For html, do it like writing XML will be fine.