Yii Framework Forum: [EXTENSION]eexcelview - Yii Framework Forum

Jump to content

  • (6 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION]eexcelview http://www.yiiframework.com/extension/eexcelview/ Rate Topic: ***** 1 Votes

#21 User is offline   bur_i 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 20-February 09

Posted 23 September 2011 - 03:45 PM

Great extension but I can't get it working with relations.

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?
0

#22 User is offline   Backslider 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 363
  • Joined: 23-July 09

Posted 02 October 2011 - 11:01 PM

How about documenting this extension? It would make life a lot easier and not leave people wasting their time.

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?
We were all once expert at....... nothing.

yii-language-behavior

My Blog
0

#23 User is offline   Preacher 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 74
  • Joined: 01-October 11

Posted 09 October 2011 - 11:21 PM

Do you know if there is a way to get the grid view to look better for the PDF output of the plugin.

Posted Image

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',)
       
));
?>

0

#24 User is offline   Preacher 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 74
  • Joined: 01-October 11

Posted 09 October 2011 - 11:40 PM

View PostPreacher, on 09 October 2011 - 11:21 PM, said:

Do you know if there is a way to get the grid view to look better for the PDF output of the plugin.

Posted Image

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/
1

#25 User is offline   Avdeev Alexey 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 19-October 11

Posted 19 October 2011 - 07:19 AM

I have a problem with 'disablePaging'.

$this->widget('application.extensions.eexcelview.EExcelView', array(
	'dataProvider' => $dataProvider,
	'disablePaging' => true,
));


Pagination is not disabled.
Tell me, what could be the case.
0

#26 User is offline   gallego123 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 535
  • Joined: 11-August 09
  • Location:Argentina

Posted 19 October 2011 - 07:34 AM

View PostAvdeev Alexey, on 19 October 2011 - 07:19 AM, said:

I have a problem with 'disablePaging'.

$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

KISS - Keep It Simple Stupid
ASAP-As Soon As Possible
http://www.yiiframew...oc/cookbook/71/
0

#27 User is offline   phreak 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 79
  • Joined: 19-February 09

Posted 19 October 2011 - 07:47 AM

View Postjackcobain, on 30 August 2011 - 09:12 AM, said:

Fatal error: Class 'CException' not found in i am getting this error.. i have also downloaded PHPExcel class from phpexcel site but still it shows fatal error... any suggestion?


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. :rolleyes:
0

#28 User is offline   bur_i 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 20-February 09

Posted 19 October 2011 - 01:37 PM

Dear author,

Is extension supposed to work with relational fields? I saw some message about path but still unlucky to make it working (
0

#29 User is offline   phreak 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 79
  • Joined: 19-February 09

Posted 20 October 2011 - 12:21 PM

View Postbur_i, on 19 October 2011 - 01:37 PM, said:

Dear author,

Is extension supposed to work with relational fields? I saw some message about path but still unlucky to make it working (

Yes, it is :) What's the problem, give us some code. It extends gridview, if you see it in the grid you shuold be eable to export.
0

#30 User is offline   jowen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 191
  • Joined: 13-July 11
  • Location:Malaysia

Posted 24 November 2011 - 02:32 AM

Hi guys

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,))
);
0

#31 User is offline   ragman 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 15-August 11

Posted 25 January 2012 - 03:36 AM

I'm dealing with a very strange issue. I created multiple excel data exports in my application. At my local develop machine all exports working great. But at my live site most exports are working but some not. I get the following error: ERR_FILE_NOT_FOUND.

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?
0

#32 User is offline   yJeroen 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 94
  • Joined: 06-September 11
  • Location:The Netherlands

Posted 05 March 2012 - 04:20 AM

Anyone know how I can force the excel datatype for columns? (for example, force the column to be text instead of numerical) And color cells/columns?

Thanks!
0

#33 User is offline   francis ja 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 27-July 11
  • Location:India

Posted 07 March 2012 - 04:47 AM

hi did some modification to extension
Added footer and relationships to eexcelview
http://francisja.tum...base-and-footer
skype: jesusloves.francis
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
0

#34 User is offline   zen∞ 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 18-October 11

Posted 17 March 2012 - 07:39 PM

View Postfrancis ja, on 07 March 2012 - 04:47 AM, said:

hi did some modification to extension
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 Attached File  EExcelView.php (8.18K)
Number of downloads: 696

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 :)
0

#35 User is offline   denisa84 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 21-January 12

Posted 21 March 2012 - 09:57 AM

Hi! I'm trying to use your extension. It seems that 'disablePaging' doesn't really work. I tried to set it true or false and I always get only the results from the first page (30 results from the pagination).
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,
0

#36 User is offline   zen∞ 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 18-October 11

Posted 26 March 2012 - 02:23 AM

View Postdenisa84, on 21 March 2012 - 09:57 AM, said:

Hi! I'm trying to use your extension. It seems that 'disablePaging' doesn't really work. I tried to set it true or false and I always get only the results from the first page (30 results from the pagination).
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 :)
0

#37 User is offline   russellfeeed 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 01-September 11

Posted 26 March 2012 - 10:29 AM

View PostJeroendh, on 05 March 2012 - 04:20 AM, said:

Anyone know how I can force the excel datatype for columns? (for example, force the column to be text instead of numerical) And color cells/columns?

Thanks!



@Jeroendh - did you solve this? I'm trying to do the same
0

#38 User is offline   zen∞ 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 18-October 11

Posted 26 March 2012 - 07:58 PM

View Postrussellfeeed, on 26 March 2012 - 10:29 AM, said:

@Jeroendh - did you solve this? I'm trying to do the same


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 '&nbsp;' . $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.
0

#39 User is offline   jayanthan.ece 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 21-December 11
  • Location:india

Posted 02 April 2012 - 03:45 AM

how can i convert both CDetailview and Cgridview (or particular <div> element as like printing using Mprint extension) on same page to pdf and excelview.that is i need to get the invoice to export in pdf pls help in this
0

#40 User is offline   slyder 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 14-May 09
  • Location:Russia

Posted 09 April 2012 - 11:21 AM

I had some error during PHPExcel import:
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.
0

Share this topic:


  • (6 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • 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