#25133 [NEW]: Spreadsheet_Excel_Writer cannot write formulas in lower case.
| From: | jkwiat03 at hotmail dot com | Date: | Mon, 18 Aug 2003 18:49:12 +0000 |
| Subject: | #25133 [NEW]: Spreadsheet_Excel_Writer cannot write formulas in lower case. | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-19998@lists.php.net to get a copy of this message | ||
From: jkwiat03 at hotmail dot com
Operating system: Windows 2K Pro
PHP version: 4.3.2
PHP Bug Type: PEAR related
Bug description: Spreadsheet_Excel_Writer cannot write formulas in lower case.
Description:
------------
I checked the bug reports and did not see this as an issue, so hopefully
no one will get too mad at me for posting this...I'm a virgin to bug
reporting :).
When using the Spreadsheet_Excel_Writer package for PEAR, formulas must be
written in capital letters. In other words, you can not write
"=SUM(a1:a10)". It must be written as "=SUM(A1:A10)".
A simple fix for this is the following:
Edit the writeFormula() function to include
$formula = strtoupper($formula);
as the first line of the function.
I don't know if this is the best way to fix the problem, but this is my
first bug report/patch, so it looks good to me :).
Reproduce code:
---------------
<?php
require_once 'Spreadsheet/Excel/Writer.php';
// We give the path to our file here
$workbook = new Spreadsheet_Excel_Writer('C:\\bugs\\bug.xls');
$worksheet =& $workbook->addWorksheet('My first worksheet');
$worksheet->write(0, 0, 1);
$worksheet->write(1, 0, 2);
$worksheet->write(2, 0, 3);
// Formula must be in upper case. This line will not work.
$worksheet->write(3, 0, "=SUM(a1:a3)");
// We still need to explicitly close the workbook
$workbook->close();
?>
Expected result:
----------------
Apache.exe - Application Error
The exception unknown software exception (0xc00000fd) occurred in the
application at location 0x0084823d.
Click on OK to terminate the program
Click on CANCEL to debug the program
--
Edit bug report at http://bugs.php.net/?id=25133&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25133&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25133&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25133&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25133&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25133&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25133&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25133&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25133&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25133&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25133&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25133&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25133&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25133&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25133&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25133&r=gnused