Here is some code.  I also have the path to pear in the vendors
directory in my include path.
.;C:\Program Files\xampp\htdocs\mem\vendors\Pear

Call from within view:

<?php
vendor('Pear\Spreadsheet\Excel\Writer');

$workbook = new Spreadsheet_Excel_Writer();
$worksheet =& $workbook->addWorksheet();

//Set Column Zoom to 75%
$worksheet->setZoom(75);

//Set Column Sizes
$worksheet->setColumn(0,0,4.43);

// Create a format for Titles
$titleFormat =& $workbook->addFormat();
$titleFormat->setBold();
$titleFormat->setSize('14');

$worksheet->write(0,1,'Events Details - Trust and
Safety',$titleFormat);
$workbook->send('ListVie1w.xls');
$workbook->close();
?>

Code from call outside of Cake:
require_once 'Spreadsheet/Excel/Writer.php';

<?php
$workbook = new Spreadsheet_Excel_Writer();
$worksheet =& $workbook->addWorksheet();

//Set Column Zoom to 75%
$worksheet->setZoom(75);

//Set Column Sizes
$worksheet->setColumn(0,0,4.43);

// Create a format for Titles
$titleFormat =& $workbook->addFormat();
$titleFormat->setBold();
$titleFormat->setSize('14');

$worksheet->write(0,1,'Events Details - Trust and
Safety',$titleFormat);
$workbook->send('ListView.xls');
$workbook->close();
?>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to