Thread

Posted on Wed Sep 13 02:38:59 2006 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 Wed Sep 13 11:05:56 2006 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.
--
Write a response
Posted on Mon Oct 16 15:43:33 2006 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;
Write a response