Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Perl CGI generating excel spreadsheet

by Anonymous Monk
on Aug 03, 2018 at 20:47 UTC ( [id://1219846]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

at the office I have a Perl CGI script that parses CSV type data and generates an excel spreadsheet. when I use the IE browser everything works ok : the browser prompts me to open or save the generated data and when I click on "open" excel starts up and properly displays the data. however when the same function is performed using chrome, it only allows me to save the file and when I attempt to run excel on the saved file I get an error message about "bad format of data". I have used several different Perl modules : (1) Spreadsheet::WriteExcel and (2) Excel::Writer::XLSX and the result is the same in both cases, IE is ok and chrome fails. Is there a Perl module to generate an older style "xls" file that my Perl CGI script could use ?

Replies are listed 'Best First'.
Re: Perl CGI generating excel spreadsheet
by Corion (Patriarch) on Aug 04, 2018 at 06:05 UTC

    Also see the cgi.pl example from Spreadsheet::WriteExcel. Maybe you aren't calling binmode in your code?

    If you show us the (short, relevant) code you're using, that helps us give you more concrete advice.

Re: Perl CGI generating excel spreadsheet
by chromatic (Archbishop) on Aug 03, 2018 at 23:30 UTC

    What Content-Type header are you sending for the spreadsheet? Can you post a short, self-contained example which demonstrates the problem?


    Improve your skills with Modern Perl: the free book.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-25 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found