Download Gridview As Pdf

Hello,

I am using PHPExcel 1.8.0 I have used eexcelview and tlbexcelview for downloading gridview as excel and csv, it works fine.

But when I try to download as PDF it does not function. First I was getting an error:


PDF Rendering library has not been defined. 

Then after reading some blogs I got to know that I have to change settings.php in PHPExcel and let it know that which provider I have to use. so I changed this code in settings.php:


/**

     * Name of the external Library used for rendering PDF files

     *	e.g.

     * 		mPDF

     *

     * @var string

     */

    private static $_pdfRendererName = 'mPDF';

So after this I am getting this error:


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

PHPExcel/Writer/PDF/mPDF.php does exist there

Can anyone please guide me what are the exact changes I need to do and in which files. If anyone of you would have setup this before in eexcelview or tlbexcelview you could easily guide me.

Thanks.

I need to know how to tell PHPExcel which PDF rendering library I want to use and where is it saved.

I’m using PHPExcel 1.8 too.


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

mean your class not included .

try to use require_once

for me i use


$phpExcelPath = Yii::getPathOfAlias('ext.excel');

require_once($phpExcelPath . DIRECTORY_SEPARATOR . 'PHPExcel.php');

require_once($phpExcelPath . DIRECTORY_SEPARATOR . 'PHPExcel/[input class php you need here]');

i change classes folder name into excel and store it in extensions/

oh before that make sure your spl_autoload_register has set …

sorry i can’t give you a proper link since this is first post

Yii Framework Autoloader compatibility fix

https:[slash][slash]phpexcel[dot]codeplex[dot]com[slash]workitem[slash]19543