Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Excel Export Error

$
0
0
$model = new User;
			$res = $model->findAll();
			$data[]=array('Name','Email');
			
			foreach($res as $list) 
			{
				$data[]=array($list['username'],$list['email']);
						
			}
			Yii::import('application.extensions.phpexcel.JPhpExcel'); 
                $xls = new JPhpExcel('UTF-8', false, 'test'); 
                $xls->addArray($data); 
                $xls->generateXML('News-letter'.date('Y-m-d'));


I am using the above code to generate excel,
Excel is downloding fine, When I opens it it shows that error , file is in different format specified in the file name,

Can any one help me?

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>