PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » File Formats » Spreadsheet_Excel_Writer » Bug #688

ouput error

Details

Submitted2004-02-05 10:17 UTC
Fromruben_bonke at hotmail dot com
Assignedxnoguer
StatusClosed
PackageSpreadsheet_Excel_Writer
PHP Version4.3.4
OSLinux
Roadmaps(Not assigned)

Comments

[2004-02-05 10:17 UTC] ruben_bonke at hotmail dot com

Description:
------------
I use version 0.6 of Spreadsheet Excel Writer.
Because it was advised I use OLE 0.4 instead of 0.5, due to the B/C break.

using OLE 0.5 the package produced an empty excel file.

using OLE 0.4 I get error output. See "Actual Result"

Please help.

Reproduce code:
---------------
<?php
require_once 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer();
$workbook->send('test.xls');
$worksheet =& $workbook->addWorksheet('My first worksheet');

$worksheet->write(0, 0, 'Name');
$worksheet->write(0, 1, 'Age');
$worksheet->write(1, 0, 'John Smith');
$worksheet->write(1, 1, 30);
$worksheet->write(2, 0, 'Johann Schmidt');
$worksheet->write(2, 1, 31);
$worksheet->write(3, 0, 'Juan Herrera');
$worksheet->write(3, 1, 32);

$workbook->close();
?>

Expected result:
----------------
a nice clean excel file. :)

Actual result:
--------------
Warning: fseek(): supplied argument is not a valid stream resource in usr/local/lib/php/OLE/PPS.php on line 154

Warning: fstat(): supplied argument is not a valid stream resource in /usr/local/lib/php/OLE/PPS.php on line 155

Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/lib/php/OLE/PPS/Root.php on line 234

(This last error repeats itself for about 500 times)

[2004-02-05 10:48 UTC] ruben_bonke at hotmail dot com

Instead of unix we are using linux. my bad.

[2004-02-06 22:14 UTC] xnoguer at php dot net

Do you have permissions on your /tmp dir?

Also, could you please try the latest Spreadsheet_Excel_Writer from cvs and use:
$workbook->setTempDir('dir_you_have_permissions_on');
and see if that works?

[2004-02-07 18:25 UTC] ruben_bonke at hotmail dot com

I do have permission in the /tmp dir.

I've installed the current Cvs version, however when I try to use the setTempDir function the following error occurs.

Fatal error: Call to undefined function: settempdir() in /usr/local/lib/php/Spreadsheet/Excel/Writer/Workbook.php on line 577

[2004-02-08 01:04 UTC] ruben_bonke at hotmail dot com

After still receiving an errormessage with the csv version installed, I also have reïnstalled OLE 5.0.

This seems to do the trick.

Spreadsheet excel writer now produces a nice clean excel file. :)

[2004-02-27 22:12 UTC] xnoguer at php dot net

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.