Content-type application/vnd.ms-excel is used when we send the real excel sheet like one created with Spreadsheet::WriteExcel. If you are sending CSV content, try using "text/csv" as content-type.
print "Content-type: text/csv\n"; #Changed content-type to CSV
print "Content-Disposition: attachement; filename=test.xls\n\n";
print $excel;
Hope this works.
--VC
There are three sides to any argument..... your side, my side and the right side.
| [reply] [d/l] [select] |
No effect. Still using excel but one record is still in one cell.
Thanks...
| [reply] |
It might help to see some sample output of the $excel variable? | [reply] |
Sample of one record as follows:
,XXX,YYY,terryc ,ZZZZZ,Palm Road,9 ,TTTT,UUU ,-3.01,-0.30,0.00,0.00,0.00,0.00,-0.30,1,SSS, ,RRR, ,QQQQQ , , , , ,33318 ,20040113,7711,
Thanks...
| [reply] |
you may need to set STDOUT to binary mode.
binmode STDOUT;
print "Content-type: application/vnd.ms-excel\n";
print "Content-Disposition: attachement; filename=test.xls\n\n";
print $excel;
| [reply] [d/l] |
No effect. Perl is run under unix, so it should have no effect.
Thanks...
| [reply] |
If you still have problems, try a module to phrase the Excel file.
"Note: An Excel file is comprised of binary data. binmode"
| [reply] |
Folks...
Thanks to all. Found the solution. Just change the test.xls to test.csv and it is formatting the csv correctly.
| [reply] |