PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » File Formats » Spreadsheet_Excel_Writer » Bug #2425

Error using writeFormula with Now() and TODAY()

Details

Submitted2004-09-30 20:10 UTC
Fromcasep at tuxpan dot com
Assignedxnoguer
StatusClosed
PackageSpreadsheet_Excel_Writer
PHP Version4.3.8
OSWindows 2000
Roadmaps(Not assigned)

Comments

[2004-09-30 20:10 UTC] casep at tuxpan dot com

Description:
------------
IF I try to insert NOW() or TODAY() as formula there is an error creating the excel.

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

$worksheet->writeFormula(0, 0, '=NOW()');

$workbook->close();
?>

Expected result:
----------------
The excel file with a cell with =NOW() as content

Actual result:
--------------
Notice: Undefined variable: result in C:\PHP\www\Spreadsheet\Excel\Writer\Parser.php on line 1643

Warning: Cannot modify header information - headers already sent by (output started at C:\PHP\www\Spreadsheet\Excel\Writer\Parser.php:1643) in C:\PHP\www\Spreadsheet\Excel\Writer.php on line 67

After several Warning lines there is some kind of excel file on the web page...

Warning: Cannot modify header information - headers already sent by (output started at C:\PHP\www\Spreadsheet\Excel\Writer\Parser.php:1643) in C:\PHP\www\Spreadsheet\Excel\Writer.php on line 71
ÐÏࡱá ...

[2005-11-12 04:15 UTC] xnoguer at php dot net

This bug has been fixed in CVS.

If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should be live shortly.

Otherwise, the fix will appear in the package's next release.

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