For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > August 2004 > Re: [PEAR] Spreadsheet_Excel_Writer problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] Spreadsheet_Excel_Writer problem
Justin Patrin

2004-07-26, 3:57 pm

On Mon, 26 Jul 2004 13:11:01 +0100, Alex Othold
<alex@adido-solutions.com> wrote:
> Hi
>
> I'm sorry if I'm posting this to the wrong newsgroup I wasn't sure which one
> to use.
>
> I have a class the utilizes the excel writer package but I'm having a few
> problems with it on my production server.
>
> My development server is a Windows XP Pro box running PHP version 4.3.5. On
> this box I dont get any problems and my class generates a valid excel
> document.
>
> My production server is a FreeBSD box running PHP version 4.3.4. With this
> box my class will create a excel document but when I go to open the file up,
> it comes back and tells me the file is unreadable.
>
> Can anyone help me with this or point me in the right direction, as its
> driving me mad.
>


Try opening the generated document in a text editor. Do you see any
messages at the top? Likely, there are notices ot warnings being
reported by PHP that are getting into the output.

--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--
Alex Othold

2004-07-26, 8:57 pm


"Justin Patrin" <papercrane@gmail.com> wrote in message
news:432beae04072611402ee26154@mail.gmail.com...
> On Mon, 26 Jul 2004 13:11:01 +0100, Alex Othold
> <alex@adido-solutions.com> wrote:
one[color=darkred]
few[color=darkred]
On[color=darkred]
this[color=darkred]
up,[color=darkred]
>
> Try opening the generated document in a text editor. Do you see any
> messages at the top? Likely, there are notices ot warnings being
> reported by PHP that are getting into the output.
>
> --
> DB_DataObject_FormBuilder - The database at your fingertips
> http://pear.php.net/package/DB_DataObject_FormBuilder
>
> paperCrane --Justin Patrin--



Hi,

Thanks for the reply.

I have checked the generated file in a text editor but it just tells me its
an empty file (0 bytes).

The query I run def returns data as I can generate a tab sperated excel file
from it.
Alex Othold

2004-08-03, 8:56 pm

Hmm.. I just did some more playing, and I solved the problem for me! It
seems that the program did not have write permission to the temp folder
because I was running in safe mode (I found this out by enabling all error
messages with 'error_reporting (E_ALL);'. After I redirected the temp folder
to a place that apache could write to, everything started working. Here's
the final working code:
$workbook = new Spreadsheet_Excel_Writer();
$workbook->setTempDir('/apache_tmp/');
$workbook->send('test.xls');
$worksheet =& $workbook->addWorksheet('Testsheet');
$worksheet->write(0, 0, 'Blah');
$workbook->close();

The Problem was solved by Ben Claar and I would like to thank him for his
help in this matter.

Alex
Adido Solutions Ltd

"Alex Othold" <alex@adido-solutions.com> wrote in message
news:20040726202824.37282.qmail@pb1.pair.com...
>
> "Justin Patrin" <papercrane@gmail.com> wrote in message
> news:432beae04072611402ee26154@mail.gmail.com...
which[color=darkred]
> one
> few
4.3.5.[color=darkred]
> On
> this
file[color=darkred]
> up,
its[color=darkred]
>
>
> Hi,
>
> Thanks for the reply.
>
> I have checked the generated file in a text editor but it just tells me

its
> an empty file (0 bytes).
>
> The query I run def returns data as I can generate a tab sperated excel

file
> from it.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com