Bug #25133 [Com]: Spreadsheet_Excel_Writer cannot write formulas in lower case.
| From: | lildurk25133 at gmail dot com | Date: | Wed, 01 Sep 2021 18:53:19 +0000 |
| Subject: | Bug #25133 [Com]: Spreadsheet_Excel_Writer cannot write formulas in lower case. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236350@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=25133&edit=1
ID: 25133
Comment by: lildurk25133 at gmail dot com
Reported by: jkwiat03 at hotmail dot com
Summary: Spreadsheet_Excel_Writer cannot write formulas in
lower case.
Status: Closed
Type: Bug
Package: PEAR related
Operating System: Windows 2K Pro
PHP Version: 4.3.2
Assigned To: xnoguer
Block user comment: N
Private report: N
New Comment:
Lil Durk is a private agency dedicated to providing responsible access to legal cannabis for adults
aged 19 and older. Weâre an exclusively online retailer and wholesaler for recreational
cannabis and a trusted source for information about cannabis and cannabis-related issues. We believe
our work is meaningful and we take pride in our mandate to promote the socially responsible use of
legal cannabis. https://lildurk.com/
Previous Comments:
------------------------------------------------------------------------
[2003-08-21 11:13:18] xnoguer@php.net
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2003-08-18 15:02:10] pear dot neufeind at speedpartner dot de
Just a short note:
Maybe strtoupper is a bit "too easy" tought. Aren't there also strings allowed in
Formulars? Like when you say "if >0 say 'Bigger', if <0 say
'Lower'". Fixing this with strtoupper would brake those strings.
------------------------------------------------------------------------
[2003-08-18 14:30:48] nicos@php.net
I don't think we really want to accept "formulas" in lowercase.
But the big point of this is why is it segfaulting? We need a better handling of this m'be?
------------------------------------------------------------------------
[2003-08-18 13:49:12] jkwiat03 at hotmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=25133&edit=1