[cgiapp] Output an excel file

Michael Peters mpeters at plusthree.com
Fri Aug 28 17:39:28 EDT 2009


fREW Schmidt wrote:
> Now I'm shooting for a little more refinement -
> creating an Excel spreadsheet using Spreadsheet::WriteExcel - and I can't
> seem it to get to print it out from the file handle.

In that case, I'd change somethings about your setup. Instead of creating the 
whole spreadsheet in memory, you should either write it out to a file and them 
stream it when finished (using CGI::Application::Plugin::Stream helps here, but 
you'd still need to clean it up afterwards, but really every web app should have 
a temp directory that periodically gets cleaned up) or print it as you create it 
(which means making the FH STDIN instead which might be trickier under mod_perl 
or maybe not).

And then remember to close your workbook when it's done.

-- 
Michael Peters
Plus Three, LP



More information about the cgiapp mailing list