[KLUG Members] PHP document writer

bill bill at billtron.com
Sat Mar 22 13:15:06 EST 2008


On Sat, 2008-03-22 at 12:37, Jason Edward Durrett wrote:
> Does anyone know of a good way to save a report rendered in PHP as an
> openoffice.org calc document?

PHP renders, generally speaking, to HTML.  In other words, it usually
takes some data and creates a web page.  Web pages are, generally,
HTML.  Browsers open HTML pages.  HTML is basically a page layout
format.  Thus, if you try to open an HTML file in Open Office it opens
it in Writer, the word processing program and lays out a text page. 
OpenOffice Calc opens spreadsheets.

You can make PHP render to things besides HTML, like calculations or
code or spreadsheets or whatever.  It isn't clear whether you're asking
to take something already done in PHP and then turn it into something
else or whether you want to use PHP to render directly into a
spreadsheet like OpenOffice calc.

Are you asking

PHP - > HTML -> Something else* -> Calc

or 

PHP* -> Calc

The asterisk indicates where the change would occur.

> There seems to be a lot of information on this and different ways about
> going about it.  I am looking for some hints on which way to go

The second option above is preferable because you save yourself a step
and it's simpler. The question is whether you can do that.  Do you have
access to the PHP code at the start?  If so, make it render to XLS or
something similar that Calc can open.  There are PHP classes that can do
that.  You still need to program them and -make- them do the rendering,
of course. 

If you don't have access to the PHP code at the start, but only the
resulting HTML, then you need something else that turns HTML into a
spreadsheet.  That "something else" may be PHP or not.

kind regards,

bill

-- 
PGP/GPG Public Key: https://billtronservices.com/key
Fingerprint: 07A1 A568 4385 FE9D DC5E  A055 A2DA EDED 45B9 2027
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://www.kalamazoolinux.org/pipermail/members/attachments/20080322/088f05e4/attachment.bin


More information about the Members mailing list