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.

enter image description here

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

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -