Thursday, May 5, 2011

Flex Export Advanced Datagrid to Excel with Grouped Headers

Hello,

I have been searching for a long time,  on how to export Advanced DataGrid  with Grouped Headers to Excel.
There are many post available on exporting to excel in various ways. But my requirement was not to use server side technology. I already had a basic code to export  Advanced DataGrid with single Header(This codes also I got from Fellow bloggers).
Then I decided to upgrade the  code to support  Grouped Headers. This code will support 3 level of Headers.
It is not an optimized code, but for people who desperately need a simple solution in short time, this would help.



Download Project

22 comments:

  1. hi nice example but i want export data from olap datagrid..can you please help me...

    ReplyDelete
  2. I am afraid I can't help you with OLAP, because I have not used it.

    ReplyDelete
  3. i am not able to download project, can you please help

    ReplyDelete
  4. If you click on the download Project link, It takes you to google docs, where it lists all the files, but you will need just this one Action Script file
    ADGExcel.as and may be example1.mxml that should be enough to have your own Datagrid.


    If you still have problem, then let me know so I can mail it to you.

    ReplyDelete
  5. i want export advanced datagrid to excel.but no need the convert html format.and not using servlets also.please help me any one..

    ReplyDelete
  6. my problem is exporting 3000records data into excel that time i got one exception data too large.i using servlets..so please help me kannan..thanks in advance..

    ReplyDelete
  7. i got this exception only..
    Parameters were not parsed because the size of the posted data was too big. Use the maxPostSize attribute of the connector to resolve this if the application should accept large POSTs.
    i using servlet.

    ReplyDelete
  8. This problem is related to the post size limit in your tomcat server.
    If you do a Google on this error, you will get the below answer

    The solution is to reconfigure Tomcat to accept larger POST requests, either by increasing
    the limit, or by disabling it. This can be done by editing Tomcat's server.xml.
    In the element, add an attribute "maxPostSize" and set a larger value (in bytes) to
    increase the limit. Setting it to 0 will disable the size check.

    ReplyDelete
  9. thanks kannan.now i got the solution..its working fine...

    ReplyDelete
  10. hi kannan i tried that Flex Export Advanced Datagrid to Excel with Grouped Headers code but its not working.i using one sevlet.if i using your full code means exception the save method undefined like its coming.

    ReplyDelete
  11. please send that example code for using servlet.

    ReplyDelete
    Replies
    1. Hi Arun,

      This export function is client side. It has nothing to do with servlet or any other server side program.

      If you need to create excel file in server, then I suggest you to use some server side library like Apache poi.

      Delete
    2. Hi Kannan,
      I using your same code itself i got some error like "udefined method for save in flash.filereference".i check the google itself.and i change flash player version. its not working.

      Delete
    3. Hi,

      this is a very common error I think,if you do some google you can find the answer.

      Delete
    4. Hi kannan,
      my datagrid have 60column .i try to download 1000records.that excel having 520 records..how i fix the issue.please help me.

      Delete
    5. Hi I have exported more than 1000 rows with 15 to 20 columns and I did not face much issue, other than a small delay in creating the file.

      If you have problem, you need to provide more information on what is the error or what is happening when you try to export.

      you message is not clear.
      And also I think having 60 columns is odd

      Delete
    6. Hi kannan,
      my datagrid have 60 columns..and i try to export the 1000rows of data.that time no exception is throwing but after exporing the excel have only 500rows.another 500rows are missing.how to fix the issue.

      Delete
  12. I am not sure, why it will go missing. but I have not faced any issue even when exporting more than 1000 rows.
    I suggest you to create excel file using server side library.

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. its showing error when i click on download project link

    ReplyDelete
  15. I am still able to navigate to the download link

    ReplyDelete
  16. Hi Kannan,

    I am unable to navigate to the download link can you please mail me at shiv.nikum@mphasis.com

    Thanks

    ReplyDelete