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

Jump to content

  • (6 Pages)
  • +
  • « First
  • 4
  • 5
  • 6
  • You cannot start a new topic
  • You cannot reply to this topic

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

#101 User is offline   kuya1284 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 17-July 12

Posted 19 February 2014 - 03:59 AM

View Postturi, on 18 February 2014 - 02:34 AM, said:

Hi,

This extension works really great with one CGrivView on a page. Is it possible to apply this extension to more than one CGrivView on the same page?

Thanks


Yes. You would do so in the same manner as rendering multiple grids on the same page, which is by passing a different dataProvider object.
0

#102 User is offline   Amjad Khan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 23-November 11

Posted 01 April 2014 - 04:09 AM

Hi,This is my controller code i cannot get the downloaded file in excel using this extension can anyone help me
public function actionExcel() {
        $model=new News('search');
    
               
              
        $this->widget('EExcelView', array(
     'dataProvider'=> $model->search(),
     'title'=>'My CSV File',
     'autoWidth'=>false,
            'grid_mode' => 'export',
            'title' => 'News Analytics',
            'filename' => 'report.xlsx',
            'stream' =>false,
            'exportType' =>'Excel2007',
//	'filter'=>$model,
            'columns' => array(
//		'pkreportid',
                array('header' => 'Sr#',
                    'value' => '$this->grid->dataProvider->pagination->offset + $row+1',
                ),
                array(
                    'header' => 'News Paper Name',
                    'name' => 'fknewspaperid',
                    'value' => '$data->Newspapername->newspapername',
                ),
                'headline',
                'pageno',
                'reportername',
                'city',
                array(
                    'header' => 'Date',
                    'name' => 'reportdate',
                ),
                array(
                    'header' => 'News Analyst',
                    'name' => 'fkuserid',
                    'value' => '$data->User->username',
                ),
            /*
              'fkcityid',
              'reportinggaps',
              'bridginggapsinfo',
              'publicbody',
              'fklawid',
             */
            ),
        ));
       
         Yii::app()->end();

    }

This code just give me a gridview on html page how to export it in excel
0

#103 User is offline   Timur Ramazanov 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 25-December 13
  • Location:Astana, Kazakhstan

Posted 22 April 2014 - 01:30 AM

Hello, is this extension still maintained?
0

#104 User is offline   ghadfrf 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 13-May 14

Posted 17 June 2014 - 05:49 AM

please can anyone tell how to add header,title to the excel sheet using this extension.

I am trying out from two days please help me,i have saw many examples nothing worked out.Help this poor newbie

Thank You In Advance.
0

#105 User is offline   Vinod Agarwal 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 08-August 13

Posted 20 April 2015 - 12:50 AM

Hi,

I have lot's of records in my table and when I try to download it as a excel using this extension. It causes my server to shut down. So basically I am unable to export large files using this extension. My Grid contains data from different tables.

So how do I download large files using this extension.
0

#106 User is offline   jayeshpatil 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 22-April 15

Posted 22 April 2015 - 08:03 AM

Thanks a lot sir, it worked.
but when my grid is updated it wont export the updated data, can you help me with that.

Thanks again
0

#107 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 513
  • Joined: 08-October 12
  • Location:Austria

Posted 22 April 2015 - 09:26 AM

I am currently using 1.8.0 phpexcel..but this little bit tricky..

1.8.0 does not have inbuild pdf library so we have to load external library like mpdf , htmlpdf, tcpdf

so download from any one vendor site and copy the folder into /protected/vendor folder

Then goto eexcelview init method and replace with this code.

what i did here is simple

i am loading rendererName and rendererLibraryPath , then i am calling setPdfRenderer of phpexcel.. It will inform

hi phpexcel i am going to use mpdf and you can load library from this renderer path :)

Have Fun


public function init()
		{
			if(isset($_GET[$this->grid_mode_var]))
				$this->grid_mode = $_GET[$this->grid_mode_var];
			if(isset($_GET['exportType']))
				$this->exportType = $_GET['exportType'];

			$lib = Yii::getPathOfAlias($this->libPath).'.php';
			if($this->grid_mode == 'export' and !file_exists($lib)) {
				$this->grid_mode = 'grid';
				Yii::log("PHP Excel lib not found($lib). Export disabled !", CLogger::LEVEL_WARNING, 'EExcelview');
			}

			if($this->grid_mode == 'export')
			{
				$this->title = $this->title ? $this->title : Yii::app()->getController()->getPageTitle();
				$this->initColumns();
				//parent::init();
				//Autoload fix
				spl_autoload_unregister(array('YiiBase','autoload'));
				Yii::import($this->libPath, true);

				$this->objPHPExcel = new PHPExcel();
				$rendererName = PHPExcel_Settings::PDF_RENDERER_MPDF;
				$rendererLibraryPath = Yii::app()->basePath . '/vendor/mpdf60';
				//  Here's the magic: you __tell__ PHPExcel what rendering engine to use
				// 	and where the library is located in your filesystem
				if (!PHPExcel_Settings::setPdfRenderer($rendererName,$rendererLibraryPath)) {
					die('NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
							'<br />' .
							'at the top of this script as appropriate for your directory structure'
					);
				}

				spl_autoload_register(array('YiiBase','autoload'));
				// Creating a workbook
				$this->objPHPExcel->getProperties()->setCreator($this->creator);
				$this->objPHPExcel->getProperties()->setTitle($this->title);
				$this->objPHPExcel->getProperties()->setSubject($this->subject);
				$this->objPHPExcel->getProperties()->setDescription($this->description);
				$this->objPHPExcel->getProperties()->setCategory($this->category);
			} else
				parent::init();
		}



I hope it will help others who are trying to upgrade 1.7 phpexcel to 1.8.0 (only pdf required this settings)
Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
0

Share this topic:


  • (6 Pages)
  • +
  • « First
  • 4
  • 5
  • 6
  • You cannot start a new topic
  • You cannot reply to this topic

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