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?
Right click on your project and select Add Reference menu. After that go to COM tab and select and add Microsoft Excel 12.0 object library. Now here is my Button click event handler where I create Excel object and document, get data from DataGridView and add rows and columns to the document. app.
From the palette on the left, under Appian Smart Service expand Documentation Generation and drag the Export Data Store Entity to Excel smart service to the canvas. Alternatively, type the word "export" in the search box above the palette, this will filter the list of smart services containing this word.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With