PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Excel Spreadsheet Writer: File Streaming?

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> File Formats
View previous topic :: View next topic  
Author Message
sp00n



Joined: 20 Jul 2007
Posts: 1

PostPosted: Fri Jul 20, 2007 4:26 pm    Post subject: Excel Spreadsheet Writer: File Streaming? Reply with quote

Hello,

I am using the PEAR Excel Spreadsheet Writer to generate a formatted excel file, which is working just fine (despite the somewhat weird merging functions, where either the cells are not properly merged (setAlign) or the height of the cell doesn't adapt to the lines present in the string (setMerge)).

Anyway, my real question is, is there some way to "stream" to file?
Currently it seems that first the file is completely generated first, and if the file is rather large (> 1 MB), it takes quite a while before the download as popup message appears.

Before I had found the Spreadsheet Writer, I was simply using the XLS headers

header("Content-type: application/vnd-ms-excel");
header("Content-Disposition: attachment; filename=export.xls");

to output a simple HTML table as an .XLS file.
The download popup would almost start immediately and then the file would be streamed to the client.
Of course, the downside of an HTML table is that actually opening the file in Excel takes forever, which is why I dropped that approach in favor of the PEAR solution.

Now, if I only could get that streaming to work...
Back to top
View user's profile Send private message
diabolik



Joined: 30 Oct 2007
Posts: 2

PostPosted: Tue Oct 30, 2007 5:24 pm    Post subject: Hi Reply with quote

Did you ever get a solution to this???
I have exactly the same problem (if I got it correctly) i.e. cannot manage to write the damn file to disk.
I've seen the method:

Workbook::&setTempDir

but it has no effect (I think it's only used as a temp, what a guess....).

So: what if I have to generate a number of Excel files, zip them and then send the whole stuff to a user??

Rolling Eyes
Back to top
View user's profile Send private message Send e-mail
diabolik



Joined: 30 Oct 2007
Posts: 2

PostPosted: Tue Oct 30, 2007 5:43 pm    Post subject: Reply with quote

Oh my gosh.... thanks to codewalker....

As simple as that!!!

$w2 = new Spreadsheet_Excel_Writer('c:/temp/cazzo.xls');

Embarassed
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> File Formats All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software