PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » File Formats » Spreadsheet_Excel_Writer » Bug #6947

Sheet name overflows buffer

Details

Submitted2006-02-27 09:56 UTC
Frommike dot jupp at bexley dot gov dot uk
Assignedjeichorn
StatusClosed
PackageSpreadsheet_Excel_Writer
PHP Version4.3.7
OSwindows/apache
Roadmaps(Not assigned)

Comments

[2006-02-27 09:56 UTC] mike dot jupp at bexley dot gov dot uk

Description:
------------
If the sheet name exceeds the limit imposed by Excel (seems to be 31 characters) the sheet allocation fails and subsequent operations cause errors.

Test script:
---------------
$xls = & new Spreadsheet_Excel_Writer();
$titleFormat=& $xls -> addFormat();
$titletext="This will fail";
$sheet = $ $xls->addWorksheet('abcdefghijklmnopqrstuvwxyz0123456789');
$sheet->write(0,0,$titletext,$titleFormat);

Expected result:
----------------
Nothing title is allocated to the sheet.

Actual result:
--------------
Error message 'Undefined function'

[2006-06-29 14:50 UTC] dh at euro-solutions dot info

IMHO Excel only supports sheetnames <=32 chars.

[2006-06-30 07:59 UTC] mike dot jupp at bexley dot gov dot uk

Yes, Daniel I guessed that was the reason, but my point was that the package should trap overlong names to prevent the error message.

[2007-06-04 08:34 UTC] mike dot jupp at bexley dot gov dot uk

An error message is better than nothing, but I would prefer it if the writer just truncated the sheet title to 32 characters.