3 Replies Latest reply on Jul 3, 2008 2:50 AM by garag

    EXPORT FLEX DATA GRID DATA TO EXCEL

    kri_gopi
      I want to export the datagrid data into excel.
      Does any one have solution.

      Gopi
        • 1. Re: EXPORT FLEX DATA GRID DATA TO EXCEL
          dolinja
          Probably not the answer you want to hear... I have my datagrid grid populating by an HTTPService exposed through mod_perl, that returns XML data. I created a little button to export to CSV for each table, have that use navigateToURL(...) to popup a new window where the url is the address of another Perl service that returns the same data as a .csv attachment (set through HTTP headers).

          I can send your clearer instructions on this if it is something you'd want to follow through on. If there is a cleaner solution, I'd also like to hear about it...

          Jason
          • 2. Re: EXPORT FLEX DATA GRID DATA TO EXCEL
            rkschulz
            We use System.setClipboard to push stuff into the clipboard. Excel expects tab (slash t) separated columns and new line (slash n) separated rows.

            Use

            dataGrid.columns gives you the columns
            dataGrid.dataProvider the underlying data

            to loop over the data of a grid and push the data into the clipboard and then tell the user to paste it.
            No trip to the server required.

            Hope this helps.

            R.
            • 3. Re: EXPORT FLEX DATA GRID DATA TO EXCEL
              garag Level 1
              Hi dolinja,
              I'm trying to do the same thing: in my application I have a datagrid and I have a button to export the datagrid in Excel. When the user click on the button, I need to open a new html window where the data are showed in the excel format (nay be also csv).
              I read that you have done this in perl. Have you got the javascript version as well? If yes, are you available to share me an example or provide me a link on the web where I can find it?

              Any suggestion will be appreciated.

              Thank you very much.

              Regards