Re: Spreadsheet_Excel_Writer problem

From: Date: Thu, 06 Jan 2005 07:37:27 +0000
Subject: Re: Spreadsheet_Excel_Writer problem
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16721@lists.php.net to get a copy of this message
On Thu, 06 Jan 2005 05:09:25 +0200, Ammar Ibrahim <ammar@gnuix.com> wrote: > I'm using Spreadsheet_Excel_Writer to generate a simple spreadsheet. > When I test my code on my local server everything worked just fine, but > when I uploaded the script to the remote host it keeps sending 0 bytes. > And excel generates an error "unable to read file". I don't think > there's a problem with the code, I think it has to do with the > webserver, any clue guys? > > Ammar Ibrahim > > Anyway, here's the code > > // Creating a workbook > $workbook = new Spreadsheet_Excel_Writer(); > > // Creating a worksheet > $worksheet =& $workbook->addWorksheet('prices'); > > $row = 0; > foreach( $prices as $price ){ > > // The actual data, 2 columns, first netcoms code, second > product retail price > $worksheet->write($row, 0, $price->netcoms_code); > $worksheet->write($row, 1, $price->retail_price); > > ++$row; > } > > // sending HTTP headers > $workbook->send( 'db_extract.xls'); > > // Let's send the file > $workbook->close(); > compare the php.ini settings. -- Justin Patrin

« previous php.pear.general (#16721) next »