I have required to convert html file (test.html) to excel in PHPExcel
myhtml file text.html it is save test.php but containt of html
please idea how to implement in this
I have required to convert html file (test.html) to excel in PHPExcel
myhtml file text.html it is save test.php but containt of html
please idea how to implement in this
You could simply read the documentation provided, but:
$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);
427 of Classes/PHPExcel/Reader/HTML.php should be if ((version_compare(PHP_VERSION, '5.4.0') >= 0) && defined(LIBXML_DTDLOAD)) {.... you'll only get the error message that you've quoted if you're not running the latest github develop branch codeok please follow this step. create a php file and in that paste this code
<?php
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment;Filename=document_name.xls");
echo "<html>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">";
echo "<body>";
... echo Your Html data...
echo "</body>";
echo "</html>";
?>
in the place of your html data echo the html part in your test.html. then run this php file you will get MS excel file named "document_name.xls" .