A light weight Yii Extension allow to the creation of simple xls spreadsheets from array data.
Requirements
Yii 1.1 or above
PHP 5 above
Usage ΒΆ
Unzip the file ExportXLS.tar.gz into protected/extensions/
Then try as below,
// Importing ExportXLS class file
Yii::Import('application.extensions.ExportXLS.ExportXLS');
// Xls Header Row
$headercolums =array('Name','age');
// Xls Data
$row=array(array('Sachin','35'),array('sehwag',30));
// Xls File Name
$filename = 'fileName.xls';
$xls = new ExportXLS($filename);
$header = null;
$xls->addHeader($headercolums);
$xls->addRow($row);
$xls->sendFile();
Happy Coding Yes It Is ........
It working as well
It is a great base for extendig exisiting xls-based libraries.
In my case, I had to change converter "utf8 => iso-8859-1" to "utf8 => iso-8859-2".
After this change, it works perfectly.
Thanks!
Doubt!
Can u please Tell me On which page we use this code in our file.? i am a newbie for this yii.. help me out..
In action
Hi vijay p s ,
We can use it in action . so this code snippets use in controllers and models, for better coding standard model is right. (Thin controller and faty models)
Nice
Simple but nice :)..
Not working for me
Undefined variable: build
this error show
how to make headers in excel sheet bold in this widget?
how to make headers in excel sheet bold in this widget? please help
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.