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

get a 0Ko file on adding a worksheet

Details

Submitted2005-08-18 15:59 UTC
Fromvincent dot clair at activis dot fr
StatusNo Feedback
PackageSpreadsheet_Excel_Writer
PHP Version5.0.2
OSLinux
Roadmaps(Not assigned)

Comments

[2005-08-18 15:59 UTC] vincent dot clair at activis dot fr

Description:
------------
I try anything I could imagine, but i don't find any solution to resolve those bug. I have no error reporting. All seems fine, except the file without content.

Test script:
---------------
require_once '../library/PEAR/Writer.php';

$xls =& new Spreadsheet_Excel_Writer();
$xls->send("contacts.xls");

$boldFormat =& $xls->addFormat();
$boldFormat->setFontFamily('Helvetica');
$boldFormat->setBold();

$fields = array('genre' => "Genre", 'nom' => "Nom", 'prenom' => "Prénom", 'raison_sociale' => "Entreprise", 'service' => "Service", 'rue' => "Adresse", 'codepostal' => "CP", 'ville' => "Ville", 'pays' => "Pays", 'mail' => "Mail", 'tel_pro' => "Téléphone professionnel", 'tel_portable' => "Téléphone portable");

$sheet =& $xls->addWorksheet('contacts');
$sheet->writeRow(0, 0, $fields, $boldFormat);

$xls->close();

Expected result:
----------------
a xls file with 1 worksheet including fields

Actual result:
--------------
a 0Ko file

[2005-11-08 13:59 UTC] xnoguer at php dot net

changing to feedback status. By the way, the send() method will send the HTTP headers to the browser, you should use it just before close().