Welcome Guest, Not a member yet? Register   Sign In
write and read excel files with codeigniter
#1

[eluser]Sudz[/eluser]
Can anybody help me,

Is there any library or helper to write and read excel file in codeigniter?
#2

[eluser]louisl[/eluser]
You can use html tables as Excel documents.
#3

[eluser]michalsn[/eluser]
[quote author="Sudhakar Prajapati" date="1303994788"]Is there any library or helper to write and read excel file in codeigniter?[/quote] No, but you can use PHPExcel http://phpexcel.codeplex.com/
CI wiki: http://codeigniter.com/wiki/PHPExcel/ and some tutorial: http://virusandlinux.baskoroadi.web.id/i...deigniter/
#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');




Theme © iAndrew 2016 - Forum software by © MyBB