PHP code to write excel spreadsheet with multiple workbooks

This is a discussion on PHP code to write excel spreadsheet with multiple workbooks within the PHP General forums, part of the PHP Programming Forums category; Hi all, I have a linux based web app which prints an html screen of results. My users really want ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-28-2008
Mary Anderson
 
Posts: n/a
Default PHP code to write excel spreadsheet with multiple workbooks

Hi all,
I have a linux based web app which prints an html screen of results.
My users really want Excel spreadsheets with the same results. There
is a PEAR application which does this, but from the PEAR description it
seems to be pretty buggy (65 open bugs, average days open 616 days) and
dated.

My spreadsheets will be somewhat simple. They will have multiple
workbooks and could be as large as 10000 rows spread out over 100
workbooks (Bigger than the code can handle, according to one of the open
bug reports). No colors, no formulas, no hyperlinks.

I've checked the archives and found an example which shows me how to
write the results of an SQL (MySQL, I am using postresql, but the
example will still work) into a very simple Excel spreadsheet with just
one table of results. Is there a way to get a php program to generate a
spreadsheet with multiple workbooks?

Thanks

Mary
Reply With Quote
  #2 (permalink)  
Old 03-28-2008
Andrew Ballard
 
Posts: n/a
Default Re: [PHP] PHP code to write excel spreadsheet with multiple workbooks

On Fri, Mar 28, 2008 at 1:12 PM, Mary Anderson
<maryfran@demog.berkeley.edu> wrote:
> Hi all,
> I have a linux based web app which prints an html screen of results.
> My users really want Excel spreadsheets with the same results. There
> is a PEAR application which does this, but from the PEAR description it
> seems to be pretty buggy (65 open bugs, average days open 616 days) and
> dated.
>
> My spreadsheets will be somewhat simple. They will have multiple
> workbooks and could be as large as 10000 rows spread out over 100
> workbooks (Bigger than the code can handle, according to one of the open
> bug reports). No colors, no formulas, no hyperlinks.
>
> I've checked the archives and found an example which shows me how to
> write the results of an SQL (MySQL, I am using postresql, but the
> example will still work) into a very simple Excel spreadsheet with just
> one table of results. Is there a way to get a php program to generate a
> spreadsheet with multiple workbooks?
>


There is an XML format that Microsoft has documented that will do
multi-workbook spreadsheets in Excel. (You can get an idea by saving
an existing spreadsheet as XML and looking at the source.) I haven't
used any libraries like PEAR to build them, but it isn't too difficult
to write with the basic PHP XML libraries like XMLWriter or DOM.

Andrew
Reply With Quote
  #3 (permalink)  
Old 03-29-2008
Christian Schmidt
 
Posts: n/a
Default Re: PHP code to write excel spreadsheet with multiple workbooks

Mary Anderson wrote:
> I have a linux based web app which prints an html screen of results.
> My users really want Excel spreadsheets with the same results. There
> is a PEAR application which does this, but from the PEAR description it
> seems to be pretty buggy (65 open bugs, average days open 616 days) and
> dated.

As long as your spreadsheets are simple without too much formatting etc., I
don't think you should worry too much about these bugs. I have used the
package in a variety of contexts without problems.

> My spreadsheets will be somewhat simple. They will have multiple
> workbooks and could be as large as 10000 rows spread out over 100
> workbooks

I assume you mean multiple worksheets, not workbooks (AFAIK there can be
only one workbook per file)? I don't have any experience with a file that big.


You may also have a look at the PHPExcel package:
http://www.phpexcel.net/


Christian
Reply With Quote
  #4 (permalink)  
Old 03-31-2008
petersprc
 
Posts: n/a
Default Re: PHP code to write excel spreadsheet with multiple workbooks

Spreadsheet_Excel_Writer will do this. There's a tutorial here:

http://www.sitepoint.com/article/pea...t_excel_writer

Regards,

John Peters

On Mar 28, 1:12 pm, maryf...@demog.berkeley.edu (Mary Anderson) wrote:
> Hi all,
> I have a linux based web app which prints an html screen of results.
> My users really want Excel spreadsheets with the same results. There
> is a PEAR application which does this, but from the PEAR description it
> seems to be pretty buggy (65 open bugs, average days open 616 days) and
> dated.
>
> My spreadsheets will be somewhat simple. They will have multiple
> workbooks and could be as large as 10000 rows spread out over 100
> workbooks (Bigger than the code can handle, according to one of the open
> bug reports). No colors, no formulas, no hyperlinks.
>
> I've checked the archives and found an example which shows me how to
> write the results of an SQL (MySQL, I am using postresql, but the
> example will still work) into a very simple Excel spreadsheet with just
> one table of results. Is there a way to get a php program to generate a
> spreadsheet with multiple workbooks?
>
> Thanks
>
> Mary


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:03 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0