php - PHPExcel +Codeigniter: Invalid character -
i trying export excel file using phpexcel , codeigniter this.
i can't download excel file output showing in console invalid character. screen shot of console output.
1. first solution
i had same probleme. use class developped eliselab
https://github.com/ellislab/codeigniter/wiki/export-to-excel-2013
for export need put on controller.
$this->load->library('export'); $this->load->model('yourmodel'); $result = $this->yourmodel->yourqueryfunction(); $this->export->to_excel($result, 'nameforfile');
2. second way
if want use phpexcel try put same charset on pages, file charset & content charset. (utf-8)
put on file header :
header('content-type: text/html; charset=utf-8');
and change type of file in utf-8 without bom
on nodepadd++ go :
click on "format" select "encode in utf-8 without bom"
i hope you.
Comments
Post a Comment