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

Not work break \n or chr('0x0A') character

Details

Submitted2005-11-23 12:25 UTC
Fromwebmaster at prominfo dot org
StatusBogus
PackageSpreadsheet_Excel_Writer
PHP Version4.4.1
OSWindows 2000 Professional
Roadmaps(Not assigned)

Comments

[2005-11-23 12:25 UTC] webmaster at prominfo dot org

Description:
------------
Not working properly breaking characters: /n or chr("0x0A") in cell. In Excel I'm use Alt+Enter to input breakline.

Test script:
---------------
<?php
require_once('Spreadsheet/Excel/Writer.php');
$workbook = new Spreadsheet_Excel_Writer();
$worksheet =& $workbook->addWorksheet('test');
$worksheet->write(0, 0, "line_1".chr("0x0A")."line_2"); // first sample
$worksheet->write(1, 0, 'line_1/nline_2'); // second sample
$str = "line1
line2";
$worksheet->write(2, 0, $str); //third sample
$workbook->send('test.xls');
$workbook->close();
?>

[2006-04-28 21:02 UTC] grawpc at hotmail dot com

Tried '\n' ?

[2006-05-18 16:58 UTC] who8mycookies at yahoo dot com

Here's how:
- Add linefeed: '\x0A'
- Add formatting: setTextWrap()