Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Spreadsheet::WriteExcel : Output to browser

Status
Not open for further replies.

nivone

Programmer
Jul 2, 2002
33
IL
HI,
When I run the below example an Excel spreadsheet opens in the browser (IE 5.5, Windows 2000) but it is empty.
No matter what I tried, it always opens empty.
Anybody knows what the problem is?
Also, what is 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") ???

Thanks.
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:


#!/usr/bin/perl -w


use strict;
use Spreadsheet::WriteExcel;

print "Content-type: application/vnd.ms-excel\n\n";

my $workbook = Spreadsheet::WriteExcel->new("-");
$workbook->write(0, 0, "Hi Excel!");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top