in reply to export to excel in CGI

I've done something similar. What I did was this: I had a page with a 'download' button. Clicking that button invoked a CGI script - but the script set its MIME type to something other that 'text/html' in the header. On most browsers, this makes you get a dialog asking if you want to 'save' or 'run' (assuming there's an associated application for that particular file type.). In my case, I was creating a .csv file (comma serparated value), and I had excel defined to be the default app for .csv files, so when I clicked 'download' I could either save the .csv file on my local hard disk, or I could open the file directly in excel (once inside excel, you can always choose 'save as' if you want to save).

Replies are listed 'Best First'.
Re^2: export to excel in CGI
by sir_com (Acolyte) on Sep 08, 2009 at 15:27 UTC
    Hi scorpio17,

    I also want to do something similar. What I want to have is: a page with a 'download' button. Upon clicking the button it will prompt you for save or open. Once you click on either save or open, it should write all the outputs in an excel file and save it to the location you have mentioned.

    Please help me on this further.

    Thanks, sir_com

      This site is not a script writing service. This site is about helping each other with concrete programming problems. You haven't shown any code and haven't told us where your problem with the code you have actually lies.

      Maybe you want to just use Querylet and/or Querylet::CGI.

      Alternatively, you want to use Spreadsheet::WriteExcel.

      But we won't write complete programs for you.