Home » File Formats » Spreadsheet_Excel_Writer » Bug #2405
Text concat operator & truncate formula
Details
| Submitted | 2004-09-27 08:34 UTC |
|---|---|
| From | erik at eldata dot se |
| Assigned | progi1984 |
| Status | Closed |
| Package | Spreadsheet_Excel_Writer |
| PHP Version | 4.3.0 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2004-09-27 08:34 UTC] erik at eldata dot se
Description:
------------
Formulas trying to concat text using the & operator appear to truncate the formula. A formula like
=A1&A2
becomes
=A1
when opened in Excel.
(noted on two different Linux machines, not working on any machine tested with either version 0.6 or 0.8)
Reproduce code:
---------------
<?
require_once ('Spreadsheet/Excel/Writer.php');
$workbook = new Spreadsheet_Excel_Writer("textbug.xls");
$worksheet =& $workbook->addWorksheet('SheetOne');
$worksheet->write(0, 0, "ONE");
$worksheet->write(1, 0, "TWO");
$worksheet->write(2, 0, "=A1&A2"); // Concat two cells
$worksheet->write(3, 0, "=\"ONE\"&\"TWO\""); // Concat two constant texts
$workbook->close();
?>
Expected result:
----------------
Four Excel cells with
ONE
TWO
ONETWO
ONETWO
where the last two are concatenations
Actual result:
--------------
Both concatenations result in cells with only the first value:
ONE
The formulas are truncated to
=A1
="ONE"