Thursday, October 10, 2013

Re: Writing data into a new worksheet using PHPExcel in Cakephp

Hello,

Do you have in your helper the following line ?
App::import('Vendor', 'PHPExcel/Classes/PHPExcel');

Assuming you put PHPExcel in APP.Vendor/PHPExcel

Cheers,
RĂ©mi


On 9 October 2013 11:49, Rajkamal Ganesan <rajkamalganesan@dreamstitude.com> wrote:
Hi Friends,

   I use PHPExcel library.

   Controller :

   public $helpers = array('PhpExcel'); 

   View :

   <?php
                $this->PhpExcel->createWorksheet(); 
$this->PhpExcel->setDefaultFont('Calibri', 12); 
$table = array( 
array('label' => __('Company'), 'width' => 'auto', 'filter' => true), 
array('label' => __('city'), 'width' => 'auto', 'filter' => true), 
array('label' => __('phone'), 'width' => 'auto')
); 
        $this->PhpExcel->addTableHeader($table, array('name' => 'Cambria', 'bold' => true)); 
foreach ($contacts as $contact) { 
$this->PhpExcel->addTableRow(array( 
$contact['Contact']['company'], 
$contact['Contact']['city'], 
$contact['Contact']['phone']
)); 
$this->PhpExcel->addTableFooter(); 
$this->PhpExcel->output(); 
?>
 
Now i get 

    

Vendor class PHPExcel not found!

Error: An Internal Error Has Occurred.

Stack Trace

Now what i am doing? please help me. 
thanks,
Rajkamal
       

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to a topic in the Google Groups "CakePHP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cake-php/R2eKtOcc-Qg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: