I'm writing a Perl based WEB application and I want to display Excel spreadsheet with data in the browser.
When I run the below example an Excel spreadsheet opens in the browser (I'm using IE 5.5, Windows 2000) but it is empty.
No matter what I tried, it always opens empty.
What is the problem?
Also, what is the meaning of the last line in the example description ("This can be useful for CGIs which have a Content-type of application/vnd.ms-excel") ???
Following is the description and the example:
2.4.6 Spreadsheet::WriteExcel Example: Output to browser
You can redirect the Spreadsheet::WriteExcel output to STDOUT using the special Perl filehandle "-". This can be useful for CGIs which have a Content-type of application/vnd.ms-excel:
print "Content-type: application/vnd.ms-excel\n\n";
my $workbook = Spreadsheet::WriteExcel->new("-");
$workbook->write(0, 0, "Hi Excel!");