• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
write and read excel files with codeigniter

#4
[eluser]Seb[/eluser]
The user guide given on the previous post is a little bit deprecated for the current CI.

You can follow the directives at http://codeigniter.com/wiki/PHPExcel/ and then for example to generate XLSX on the fly :

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

$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0);
$objPHPExcel->getActiveSheet()->SetCellValue('A1', 'Hello');
$objPHPExcel->getActiveSheet()->SetCellValue('B2', 'world!');

$objWriter = IOFactory::createWriter($objPHPExcel, 'Excel2007');

header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="Filename.xlsx"');
header('Cache-Control: max-age=0');
$objWriter->save('php://output');


Messages In This Thread
write and read excel files with codeigniter - by El Forum - 04-28-2011, 01:46 AM
write and read excel files with codeigniter - by El Forum - 04-28-2011, 04:26 AM
write and read excel files with codeigniter - by El Forum - 04-28-2011, 05:39 AM
write and read excel files with codeigniter - by El Forum - 06-01-2011, 07:57 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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