Posted on 2006-09-12 23:38:59-07 by srid
Generate Excel in memory
Hello I am using Spreadsheet::WriteExcel module to generate Excel, it works perfectly. I was wondering if there is a way to generate the Excel in memory as opposed to creating a .xls file. I know that I can use the MIME type as application/Excel and have a long sting with comma delimited. But, for large data, appending into a string does not work well and it is too slow. Please let me know if there are any better ideas. Thanks in advance. Sridhar
Direct Responses: 3013 | 3265 | Write a response
Posted on 2006-09-13 08:05:56-07 by jmcnamara in response to 3011
Re: Generate Excel in memory

Semi-automated response:

Hi,

Can you please post your question to the Spreadsheet::WriteExcel Google-Group.

http://groups.google.com/group/spreadsheet-writeexcel

Thank you,

John.
--
Direct Responses: Write a response
Posted on 2006-10-16 12:43:33-07 by palincss in response to 3011
Re: Generate Excel in memory
The module's documentation for the new() method calls what you want to do "writing a file to a scalar" and shows the following example:
# Requires perl 5.8 or later open my $fh, '>', \my $str or die "Failed to open filehandle: $!"; my $workbook = Spreadsheet::WriteExcel->new($fh); my $worksheet = $workbook->add_worksheet(); $worksheet->write(0, 0, "Hi Excel!"); $workbook->close(); # The Excel file in now in $str. Remember to binmode() the output # filehandle before printing it. binmode STDOUT; print $str;
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.