CakePHP 2.x - Excel reader/writer integration -


is familiar integrating excel reader/writer export in cakephp 2.x? appreciated.

thanks in advance! peace. xd

simpliest answer is:

download phpexcel https://phpexcel.codeplex.com/releases/view/119187

extract content of classes folder app/vendor directory.

in controller create function like:

public function toexcel(){     app::import('vendor', 'phpexcel', array('file' => 'phpexcel.php'));     $objphpexcel = new phpexcel();     $objphpexcel->removesheetbyindex(0);      // code here      // save file     $objwriter = new phpexcel_writer_excel2007($objphpexcel);     $filenamewithpath = tmp.'reports/test.xlsx';      $objwriter->save($filenamewithpath);      // response - let user download     $this->response->file($filenamewithpath, array('download' => true, 'name' => $filename));     return $this->response;  } 

read documentation know next


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -