PHPExcel with CodeIgniter

#1
[eluser]Unknown[/eluser]
Hi all,
has anyone got latest version of PHPExcel to work with latest CodeIgniter? I have followed http://codeigniter.com/wiki/PHPExcel but I'm stuck with an error message saying "Fatal error: Class 'PHPExcel_Shared_ZipStreamWrapper' not found in x:\....\application\libraries\common\PHPExcel\PHPExcel\Autoloader.php on line 29".
I have also tried some other ways from the article discussion for the wiki article but no luck (like adding it as a helper(plugin)).

Anyone got an idea or alternative library for writing Excel files?

Thanks

#2
[eluser]kreamik[/eluser]
CI has flexible way to implemented another php class to it's library ..
i just use it for my project,

i just copy their class to library and use it like another library in CI default library in controller:

example :

Code:
$this->load->library('phpexcel/PHPExcel');

$sheet = $this->phpexcel->getActiveSheet();
$sheet->getColumnDimension('A')->setWidth(5);
$sheet->setCellValue('A1','First Row');

$writer = new PHPExcel_Writer_Excel5($this->phpexcel);
header('Content-type: application/vnd.ms-excel');
$writer->save('php://output');

will print "First Row" in column A1

note :
no need to follow that wiki and you have to make sure library folder should be :
ci_app/libraries/phpexcel/PHPExcel.php (just download phpexcel class from their original source)

source :
[email=http://modije.in/blog/?p=9]http://modije.in/blog/?p=9[/email]

#3
[eluser]Unknown[/eluser]
Thank you very much I got it working now :-)


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.