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 #2405

Text concat operator & truncate formula

Details

Submitted2004-09-27 08:34 UTC
Fromerik at eldata dot se
Assignedprogi1984
StatusClosed
PackageSpreadsheet_Excel_Writer
PHP Version4.3.0
OSLinux
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"