| 
	
 | 
 Posted by Paul on 10/04/07 14:13 
When I try examples from the docs, it writes out a 0 byte *.xls file.  For  
example: 
<?php 
require_once 'Spreadsheet/Excel/Writer.php'; 
$workbook = new Spreadsheet_Excel_Writer(); 
 
$format_bold =& $workbook->addFormat(); 
$format_bold->setBold(); 
 
$format_title =& $workbook->addFormat(); 
$format_title->setBold(); 
$format_title->setColor('yellow'); 
$format_title->setPattern(1); 
$format_title->setFgColor('blue'); 
 
$worksheet =& $workbook->addWorksheet(); 
$worksheet->write(0, 0, "Quarterly Profits for Dotcom.Com", $format_title); 
// While we are at it, why not throw some more numbers around 
$worksheet->write(1, 0, "Quarter", $format_bold); 
$worksheet->write(1, 1, "Profit", $format_bold); 
$worksheet->write(2, 0, "Q1"); 
$worksheet->write(2, 1, 0); 
$worksheet->write(3, 0, "Q2"); 
$worksheet->write(3, 1, 0); 
 
$workbook->send('test.xls'); 
$workbook->close(); 
?>My installation is: 
PHP 4.3 
OpenOffice 2.3 (but it doesn't open in MS Excel either) 
OLE 0.5 beta 
Spreadsheet_Excel_Writer 0.9.1 beta 
 
Any ideas what's going wrong?
 
  
Navigation:
[Reply to this message] 
 |