Page 1 of 1
generate excel
#1
Posted 09 May 2011 - 01:18 AM
hi all,
Can anybody tell me how to generate an excel onclick of a button. I have gone through the documentation phpexcel but i dont know how to implement it. Can anybody show me an example.
Thankyou
Can anybody tell me how to generate an excel onclick of a button. I have gone through the documentation phpexcel but i dont know how to implement it. Can anybody show me an example.
Thankyou
#2
Posted 09 May 2011 - 01:51 AM
This is solved. I figured out how to use it.
Just had to insert this code in the controller
Just had to insert this code in the controller
public function actionGenerate()
{
$model=new Purchases;
$data = array(
1 => array ('Name', 'Surname'),
array('Schwarz', 'Oliver'),
array('Test', 'Peter')
);
Yii::import('application.extensions.phpexcel.JPhpExcel');
$xls = new JPhpExcel('UTF-8', false, 'My Test Sheet');
$xls->addArray($data);
$xls->generateXML('my-test');
$this->render('create',array(
'model'=>$model,
));
}
#6
Posted 30 October 2011 - 01:35 AM
mithila, on 09 May 2011 - 02:02 AM, said:
HI qwerty,
The excel file that i generated is corrupt. Can u tell me how to fix this?
Thanks
Mithila
The excel file that i generated is corrupt. Can u tell me how to fix this?
Thanks
Mithila
maybe this discussion will help - http://phpexcel.code...cussions/211116
#7
Posted 21 March 2012 - 03:47 AM
Hi mithila, i'm interested with yr topic cause i faced the same thing..
this' my problem. I'd like to export my table (gotten from sql) into excel format. but i really have a doubt with it.. Do you have any suggestion for me? A lot of thanks
this' my problem. I'd like to export my table (gotten from sql) into excel format. but i really have a doubt with it.. Do you have any suggestion for me? A lot of thanks
#8
Posted 19 June 2012 - 04:21 AM
you can try the code generated by my extension giiplus CRUD generator:
http://www.yiiframew...ension/giiplus/
http://www.yiiframew...ension/giiplus/
#9
Posted 21 July 2012 - 01:23 AM
sirin k, on 19 June 2012 - 04:21 AM, said:
you can try the code generated by my extension giiplus CRUD generator:
http://www.yiiframew...ension/giiplus/
http://www.yiiframew...ension/giiplus/
Hi Sirin,
I want to use your extension, but the additional 3 features are never generated.
I've copied the giiplus.zip into extension directory & I use Yii bootstrap.
Here's my gii Module config:
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'xxxxx',
'ipFilters'=>array('127.0.0.1','::1'),
'generatorPaths'=>array('bootstrap.gii','ext.giiplus'),
),
and the following is my component's config:
'components'=>array(
.....
'bootstrap'=>array(
'class'=>'ext.bootstrap.components.Bootstrap',
),
),
What is missing from my system configuration?
Thank you Sirin!
Share this topic:
Page 1 of 1

Help














