I followed the guidelines on the bakery relating to this article: http://bakery.cakephp.org/articles/view/generate-excel-spreadsheets-from-your-database
Downloaded the two files: http://webdesign.janenanneriet.nl/excel_writer.zip http://webdesign.janenanneriet.nl/ole.zip extracted to ROOT/vendors/ copied helper file to ROOT/app/views/helpers/excel.php added a function on my controller > function export() { > $data = array(); > $data['sheet1'] = $this->Billing->findAll(NULL, NULL, 'id ASC', > NULL, 1, 2); > $this->set('data', $data); > > //print_r($data); > > $this->render('export', 'excel'); > } > Now, i created a ROOT/app/views/controller/export.ctp using this: http://bakery.cakephp.org/articles/download_code/315/block/2 And, when i run this on my browser i got this weird OLE errors.. Notice (8): Constant OLE_PPS_TYPE_ROOT already defined > [/usr/local/php5/lib/php/OLE.php, line 26] > > Context | Code$args = array(0 => "ole/OleRoot") > $c = 1 > $i = 0 > $arg = "ole/OleRoot" > > /** > * Constants for OLE package > */ > > define('OLE_PPS_TYPE_ROOT', 5); > define('OLE_PPS_TYPE_DIR', 1); > > define - /usr/local/php5/lib/php/OLE.php, line 26 > require_once - /usr/local/php5/lib/php/OLE.php, line 26 > require_once - /usr/local/php5/lib/php/OLE/PPS.php, line 24 > require_once - /usr/local/php5/lib/php/Ole.php, line 34 > require_once - CORE/vendors/ole/OlePps.php, line 23 > require_once - CORE/vendors/ole/OleRoot.php, line 23 > vendor - CORE/cake/basics.php, line 751 > require - CORE/app/views/helpers/excel.php, line 13 > loadHelper - CORE/cake/basics.php, line 499 > View::_loadHelpers() - CORE/cake/libs/view/view.php, line 827 > View::_render() - CORE/cake/libs/view/view.php, line 729 > View::render() - CORE/cake/libs/view/view.php, line 320 > BillingsController::render() - CORE/cake/libs/controller/controller.php, > line 664 > BillingsController::export() - > CORE/app/controllers/billings_controller.php, line 72 > Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 276 > Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 248 > require - CORE/app/webroot/index.php, line 85 > [main] - CORE/index.php, line 63 > Constant OLE_PPS_TYPE_DIR already defined [* > /usr/local/php5/lib/php/OLE.php*, line *27*] > Constant OLE_PPS_TYPE_FILE already defined [* > /usr/local/php5/lib/php/OLE.php*, line *28*] > Constant OLE_DATA_SIZE_SMALL already defined [* > /usr/local/php5/lib/php/OLE.php*, line *29*] > Constant OLE_LONG_INT_SIZE already defined [* > /usr/local/php5/lib/php/OLE.php*, line *30*] > Constant OLE_PPS_SIZE already defined [*/usr/local/php5/lib/php/OLE.php*, > line *31*] > > *Fatal error*: Cannot redeclare class ole in * > /usr/local/php5/lib/php/Ole.php* on line *43* > Please help! -- Louie Miranda ([EMAIL PROTECTED]) http://www.axishift.com Security Is A Series Of Well-Defined Steps chmod -R 0 / ; and smile :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
