Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: export to excel in CGI

by gwadej (Chaplain)
on Sep 03, 2009 at 13:36 UTC ( #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


Comment on Re: export to excel in CGI
Re^2: export to excel in CGI
by stonecolddevin (Vicar) 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
Node Status?
node history
Node Type: note [id://793187]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2014-12-28 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls