[EXTENSION]eexcelview http://www.yiiframework.com/extension/eexcelview/
#21
Posted 23 September 2011 - 03:45 PM
Trying to get property of non-object
$value=$this->evaluateExpression($column->value ,array('data'=>$data[$row]));
Could someone advise me how to deal with such issue?
#22
Posted 02 October 2011 - 11:01 PM
cGridView has filters, so how do we use this extension while taking advantage of filters? For example, I have a gridview and one of the columns is "Country", with a drop menu in the filters. If I select a country, how do I export the result using this extension?
#23
Posted 09 October 2011 - 11:21 PM

This is my code:
PS The Title doesn't show up on the PDF either.
<?php $bUrl=Yii::app()->baseUrl; $this->widget('application.extensions.EExcelView', array( 'id'=>'pms-grid', 'autoWidth'=>false, 'dataProvider'=>$model->search(), 'title'=>'Preventative Maintenance History', 'exportType'=>'PDF', 'columns'=>array( 'id', 'asset_id', 'type_of_maintenance', 'scheduled_maintenance:boolean', 'unscheduled_maintenance:boolean', 'schduled_date',) )); ?>
#24
Posted 09 October 2011 - 11:40 PM
Preacher, on 09 October 2011 - 11:21 PM, said:

This is my code:
PS The Title doesn't show up on the PDF either.
<?php $bUrl=Yii::app()->baseUrl; $this->widget('application.extensions.EExcelView', array( 'id'=>'pms-grid', 'autoWidth'=>false, 'dataProvider'=>$model->search(), 'title'=>'Preventative Maintenance History', 'exportType'=>'PDF', 'columns'=>array( 'id', 'asset_id', 'type_of_maintenance', 'scheduled_maintenance:boolean', 'unscheduled_maintenance:boolean', 'schduled_date',) )); ?>
I found this patch on the website to fix thick borders, a lot better not perfect but fixes a border 0 bug:
# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/matthias/NetBeansProjects/Flotilla/code/classes/objects/PHPExcel/Writer # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: HTML.php --- HTML.php Base (BASE) +++ HTML.php Locally Modified (Based On LOCAL) @@ -222,7 +222,7 @@ */ private function _mapBorderStyle($borderStyle) { switch ($borderStyle) { - case PHPExcel_Style_Border::BORDER_NONE: return '0px'; + case PHPExcel_Style_Border::BORDER_NONE: return '1px hidden'; case PHPExcel_Style_Border::BORDER_DASHDOT: return '1px dashed'; case PHPExcel_Style_Border::BORDER_DASHDOTDOT: return '1px dotted'; case PHPExcel_Style_Border::BORDER_DASHED: return '1px dashed';
Attached is the corrected file:
Replace /protected/extensions/PHPExcel/Writer/
#25
Posted 19 October 2011 - 07:19 AM
$this->widget('application.extensions.eexcelview.EExcelView', array( 'dataProvider' => $dataProvider, 'disablePaging' => true, ));
Pagination is not disabled.
Tell me, what could be the case.
#26
Posted 19 October 2011 - 07:34 AM
Avdeev Alexey, on 19 October 2011 - 07:19 AM, said:
$this->widget('application.extensions.eexcelview.EExcelView', array( 'dataProvider' => $dataProvider, 'disablePaging' => true, ));
Pagination is not disabled.
Tell me, what could be the case.
put in the call at CActiveDataProvider the parameter pagination
in your code
$dataProvider = new CActiveDataProvider($model,array('pagination'=>false)), $this->widget('application.extensions.eexcelview.EExcelView', array( 'dataProvider' => $dataProvider, //'disablePaging' => true, //not here ));
you can see an example in http://www.yiiframew...post__p__101015
This post has been edited by Horacio Segura: 19 October 2011 - 07:36 AM
#27
Posted 19 October 2011 - 07:47 AM
jackcobain, on 30 August 2011 - 09:12 AM, said:
For anyone with this error - the reason is that PHPExcel is not in the correct folder. It is currently hardcoded to 'application.extensions.phpexcel.Classes.PHPExcel'.
............. //Autoload fix spl_autoload_unregister(array('YiiBase','autoload')); Yii::import('application.extensions.phpexcel.Classes.PHPExcel', true); $this->objPHPExcel = new PHPExcel(); spl_autoload_register(array('YiiBase','autoload')); ...............
What happens is this:
- Yii's autoload is unregistered.
- The widget's tries to load the PHPExcel class
- It doesnt find the class, so try to throw CException
- Cannot find CException because autoloader is unregistered
I will add check in the new version, i've just been really busy lately.

#28
Posted 19 October 2011 - 01:37 PM
Is extension supposed to work with relational fields? I saw some message about path but still unlucky to make it working (
#29
Posted 20 October 2011 - 12:21 PM
bur_i, on 19 October 2011 - 01:37 PM, said:
Is extension supposed to work with relational fields? I saw some message about path but still unlucky to make it working (
Yes, it is

#30
Posted 24 November 2011 - 02:32 AM
eexcelview extension suppose put in controller side, right??
1.$this->widget('EExcelView', array( 'dataProvider'=> $dataprovider, 'title'=>'Title', 'autoWidth'=>false, )); 2.$this->widget('application.extensions.eexcelview.EExcelView', array( 'dataProvider' => $dataProvider, ));
which one at above is the correct one??
The link at menu panel is to allow user click and render to excel action and save the excel file??
$this->menu=array(
array('label'=>'List', 'url'=>array('index')),
array('label'=>'Crete', 'url'=>array('create')),
array('label'=>'Export to Excel', 'url'=>array('excel',
'title'=>'Cantones',
'model'=>'Canton',
'items'=>$serialized,))
);
#31
Posted 25 January 2012 - 03:36 AM
This is weird because the exports are very basic and the same as those which are working great.
All exports are including the ones failing at my live server build the same way (except attributes), like this:
<?php $data=new CActiveDataProvider('User'); $this->widget('EExcelView', array( 'dataProvider'=> $data, 'title'=>'Users', 'autoWidth'=>true, 'columns'=>array( 'name', 'lastname', 'address', ), )); ?>
Anyone idea why I'm having this issue?
#32
Posted 05 March 2012 - 04:20 AM
Thanks!
#33
Posted 07 March 2012 - 04:47 AM
Added footer and relationships to eexcelview
http://francisja.tum...base-and-footer
Blogs:
http://yiideveloper.wordpress.com/
http://francis-yii-developer.me
Co-founder of Nintriva Wireless
mails:
jesusloves.francis@gmail.com
francis@nintriva.com
http://nintriva.com
#34
Posted 17 March 2012 - 07:39 PM
francis ja, on 07 March 2012 - 04:47 AM, said:
Added footer and relationships to eexcelview
http://francisja.tum...base-and-footer
I made some modification over your existing code, many thanks.
Mainly i fixed some minor bugs and made performance improvements over the original code. Also I added support for passing the PHPExcel path as a param.
Download

Number of downloads: 860
Besides,
I created a wrapper for this extension, so you could easily deploy it and use it with many sets of data: you'll find it here: http://www.yiiframew...ension/toexcel/
Hope it helps, and many greet to all

#35
Posted 21 March 2012 - 09:57 AM
Do you have any idea why doesn't work?
Another question is ...when i set the type as csv I still get the first 30 rows and then there is a html code combined with Sql code and i don't get it.
I need help

Thanks,
#36
Posted 26 March 2012 - 02:23 AM
denisa84, on 21 March 2012 - 09:57 AM, said:
Do you have any idea why doesn't work?
Another question is ...when i set the type as csv I still get the first 30 rows and then there is a html code combined with Sql code and i don't get it.
I need help

Thanks,
Hi, for the first question, the option for disabling paging doesn't work, you neet to set it manually on your CActiveDataProvider.
For the second options, i suspect you have an error in your query or you are trying to access data that dont exist in your data set (null pointers), so yii brings up and error and so it prints html and sql (error code). Try looping and echo'ing to screen your data set in order to check this error.
Greets

#38
Posted 26 March 2012 - 07:58 PM
russellfeeed, on 26 March 2012 - 10:29 AM, said:
I tried many workarounds for this issue and I came up with a cheap trick.
First, create a getter in your model for the numeric attribute you want to export as text
<?php public getTextID() { return ' ' . $this->id; }
And in the widget in the columns array
... 'columns'=>array( 'textID:html:ID', ... )
Hope it helps

PD: You cant create your own CFormatter, so you can simply put 'id:yourFormatter' instead of defining a getter and all. I thinks that would work too, didn't try it, thou.
#39
Posted 02 April 2012 - 03:45 AM
#40
Posted 09 April 2012 - 11:21 AM
Yii::import('application.extensions.phpexcel.Classes.PHPExcel', true);
and as result had next message (because autoload was reset to PHPExcel autoload function):
Fatal error: Class 'CExceptionEvent' not found in C:\Projects\.libs\yii-framework-1_1_10\base\CApplication.php on line 707
And next fix will help to show Yii exception page if some error occurred during PHPExcel importing:
spl_autoload_unregister(array('YiiBase','autoload')); try { Yii::import('application.extensions.phpexcel.Classes.PHPExcel', true); } catch (Exception $e) { spl_autoload_register(array('YiiBase','autoload')); throw $e; } $this->objPHPExcel = new PHPExcel(); spl_autoload_register(array('YiiBase','autoload'));
Hope this help to someone else.