in reply to Re: export to excel in CGI
in thread export to excel in CGI


I've seen cases in the past where the Excel file to download was actually a CSV. This is much easier to generate than a real Excel file.

It can actually be quite tricky to generate a CSV file that Excel will read. Especially if your data contains commas, quotes, newlines or other significant entities.

Normally it isn't something that should be attempted without a module such as Text::CSV_XS. In which case it is just as easy to use Spreadsheet::WriteExcel and produce a real Excel file.

--
John.

Replies are listed 'Best First'.
Re^3: export to excel in CGI
by gwadej (Chaplain) on Sep 08, 2009 at 18:16 UTC

    For a simple numeric table, CSV is not particularly hard (no escapes or quotes needed).

    In the general case, I agree, a CSV module would be preferred. I vaguely remember problems getting Spreadsheet::WriteExcel installed on a system a few years ago. Which is why I suggested an alternate approach.

    G. Wade