Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: export to excel in CGI

by gwadej (Chaplain)
on Sep 03, 2009 at 13:36 UTC ( [id://793187]=note: print w/replies, xml ) Need Help??


in reply to 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.

G. Wade

Replies are listed 'Best First'.
Re^2: export to excel in CGI
by stonecolddevin (Parson) on Sep 05, 2009 at 21:25 UTC

    I'd say CSV is probably the best in terms of portability.  Excel reads these just fine.

     

    +1 to you sir.


      I'd say CSV is probably the best in terms of portability.

      The files produced by Spreadsheet::WriteExcel are just as portable as CSV files. In addition they can provide features that CSV files cannot such as multiple worksheets, formatting, merged ranges, printing options and embedded images to name a few.

      --
      John.

Re^2: export to excel in CGI
by jmcnamara (Monsignor) on Sep 08, 2009 at 16:24 UTC

    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.

      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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://793187]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-19 11:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found