Yii Framework Forum: Yii Basic Gii With Export Pdf Excel - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii Basic Gii With Export Pdf Excel I have extended basic gii for export to pdf-excel feature

#1 User is offline   Abhishek Shah 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 91
  • Joined: 20-July 12
  • Location:New Jersey,USA

Posted 28 March 2013 - 06:52 AM

I have refered , extension giiplus by sirin k.Our requirement,do not allow me to use bootstrap views.I have to add export to pdf-excel functionality in basic gii crud template only,So I have extended ,gii ,I have attached ,that for your referance.
Steps to use it,
1.Extract gii-extended.zip, to protected/extensions ,write in config main.php,
in gii,add line
'generatorPaths'=>array(
'ext.gii-extended',
),
For eg.'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'secure',
'generatorPaths'=>array(
'ext.gii-extended',
),
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1','192.168.0.163'),
), ),
2.extract,tcpdf ,in extensions.you can download it from here.tcpdf
3.Than,from gii,you will get two new generators,edusecModel generator and edusecCrud generator,try to use them and you will be able to get gii crud with 2 new functionalities,export to pdf and excel.you will get data from session(data in gridview will be exported).

If you want to make your own crud ,you can do it by following steps,
The gii ,if you see url, u are seeing all generatoers on index,u will find it on framework/gii/views/index.php
Here you can,if you want to add any other type of generator,U can make it easily.See gii/generators,for referance.
Now we are starting to make our new generator,like crud generator:
For that make a folder,name suppose giiextended, in extensions folder.Make folder with your custom name,suppose mycrud,
1.Make Code file,like myCrudCode in mycrud,which extends CrudCode.Import
Yii::import('gii.generators.crud.CrudCode');
2.Make generator in giiextended folder,like MyCrudGenerator,which extends CrudGenerator,in which change $codeModel,which give path to code file,here myCode.
Import : Yii::import('gii.generators.
crud.CrudGenerator');
$codemodel=giiextended.myCrud.myCrudCode.
Also make it in mycrud,where $codemodel=ext.giiextended.myCrud.myCrudCode
please notice that,if folder name is mycrud,generate will be name of MycrudGenerator,first letter will be capital.
3.Make Folder template in mycrud folder,in which all views as u want.
4.Make a folder view,put a index.php in it,
copy it form crud(framework/gii/generators/crud/view/index.php) ,change name in h1 tag.
5.In config/main.php,in gii in generatorpath array,add ext.giiextended.
as example:
'generatorPaths'=>array(
//'ext.gii-extended',
),
Here ,I have also extended a model,for a session purpose.You can extend it from ModelGenerator.

Attached File(s)


Feel free to ask for help,
Abhishek.
Yii Basic Gii With Export Pdf Excel
2

#2 User is offline   Atilla 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 14-March 13

Posted 01 April 2013 - 07:32 AM

Did everythig as you told, but there isn`t any edusecModel and edusecCrud generators.
0

#3 User is offline   Abhishek Shah 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 91
  • Joined: 20-July 12
  • Location:New Jersey,USA

Posted 02 April 2013 - 02:31 AM

Have you put in extensions folder and change config file,than it should work.try to make logout and run application again,so that config file run again.Got any error?run gii in your application,you will definately get it.May be permission issue,try to give permission,if still not working.
Feel free to ask for help,
Abhishek.
Yii Basic Gii With Export Pdf Excel
0

#4 User is offline   ravi49 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 31-January 15

Posted 13 February 2015 - 02:10 AM

EdusecCrud Generator,EdusecModel Generator both came then next what we want to do
0

#5 User is offline   ravi49 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 31-January 15

Posted 13 February 2015 - 02:46 AM

both genrators came but showing error Class 'GeneratePdf' does not exist or has syntax error.

Attached File(s)


0

#6 User is offline   ravi49 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 31-January 15

Posted 18 February 2015 - 05:25 AM

PHP warning

include(IndexColumn.php): failed to open stream: No such file or directory

Attached File(s)


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users