Xphpexcel Exteneion : Not Working In Export Phpfile To Excel.yii


i am using export data thru excel using extension:PHPExcel with XPHPExcel.

when i am set my reportfile in that code ,it will not support.gives an error…

my extension path is:


and in phpexcel folder :vendor folder,XPHPExcel.php ,README.md file

in my controller file action code is given below…

 public function actionCreateExcel()



       $phpExcel = XPHPExcel::createPHPExcel();


      $objPHPExcel= XPHPExcel::createPHPExcel();


                             ->setLastModifiedBy("Janvi Kapopara")


                             ->setSubject("Office 2007 XLSX Test Document")

                             ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")

                             ->setKeywords("office 2007 openxml php")

                             ->setCategory("Test result file");




		    ->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_TEXT);

// Add some data



	    ->setCellValue('A1', 'Report')

            ->setCellValue('B2', 'Rudra ch!')

            ->setCellValue('C1', 'Hello')

            ->setCellValue('D2', 'world!')

	    ->setCellValue('E2','Janvi Kapopara')






// Miscellaneous glyphs, UTF-8


            ->setCellValue('A4', 'janvi')

            ->setCellValue('A5', 'hello janvi')




// Rename worksheet




// Set active sheet index to the first sheet, so Excel opens this as the first sheet



// Read the contents of the file into PHPExcel Reader class

$reader = new PHPExcel_Reader_HTML(); 

$objPHPExcel = $reader->load('/var/www/html/edusec_temp/bapucollege/protected/views/report/test.php'); 

// Pass to writer and output as needed

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');


$cacheMethod = PHPExcel_CachedObjectStorageFactory:: cache_to_discISAM;

$cacheSettings = array( 'dir'  => '/usr/local/tmp' // If you have a large file you can cache it optional


PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);

/** connection with the database 1.0 */

    $dbhost = "localhost";

    $dbuser = "root";

    $dbpass = "ubuntu";

    $dbname = "bapu_25082014";



$org_id = Yii::app()->user->getState('org_id');




                    ->from('student_transaction st')

		    ->join('student_info stud_info', 'stud_info.student_info_transaction_id = st.student_transaction_id')

                    ->where(' st.student_transaction_organization_id='.$org_id.' AND st.student_transaction_detain_student_flag NOT IN (1,2) order by stud_info.student_enroll_no ASC')


 		foreach($student as $s )




	if ($sid) {

/** Create a new PHPExcel object 1.0 */

   $objPHPExcel = new PHPExcel();



/** Loop through the result set 1.0 */

    $rowNumber = 1; //start in cell 1

    //while ($row = mysql_fetch_row($sid))

	foreach ($sid as $s) {

       $col = 'A'; // start at column A

       foreach($sid as $cell) {







$objReader = new PHPExcel_Reader_HTML();

$objPHPExcel = @$objReader->load('/var/www/html/edusec_temp/bapucollege/protected/views/report/test.html');

header('Content-Type: application/vnd.ms-excel');

header('Content-Disposition: attachment;filename="ExportProduseOportunitati.xls"');

header('Cache-Control: max-age=0');

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');



// Redirect output to a client’s web browser (Excel5)

header('Content-Type: application/vnd.ms-excel');

header('Content-Disposition: attachment;filename="01simple.xls"');

header('Cache-Control: max-age=0');

// If you're serving to IE 9, then the following may be needed

header('Cache-Control: max-age=1');


// If you're serving to IE over SSL, then the following may be needed

header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past

header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified

header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1

header ('Pragma: public'); // HTTP/1.0


$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');




when i run this it gives me an error :

" DOMDocument::loadHTMLFile() expects exactly 1 parameter, 2 given "

i have create my test.php file and put the data in it as:


$inputFileType = 'HTML';

$inputFileName = './myHtmlFile.html';

$outputFileType = 'Excel2007';

$outputFileName = './myExcelFile.xlsx';

$objPHPExcelReader = PHPExcel_IOFactory::createReader($inputFileType);

$objPHPExcel = $objPHPExcelReader->load($inputFileName);

$objPHPExcelWriter = PHPExcel_IOFactory::createWriter($objPHPExcel,$outputFileType);

$objPHPExcel = $objPHPExcelWriter->save($outputFileName);


pls suggest some solution pls… i ve to complete this…