Skip to content Skip to sidebar Skip to footer

Phpexcel Display Sheet(2) In Html

I have to display an excel workbook in html form because some will view the page with Macbooks and for sure not everybody has excel installed. The workbook has five sheets which ha

Solution 1:

Perhaps by using the HTML Writer's writeAllSheets() method

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'HTML');
$objWriter->writeAllSheets();
$objWriter->save('php://output');

Note that the writer name, 'HTML' should be uppercase, some operating systems are case-sensitive

Solution 2:

Thanks Mark! You gave me a hint to what I want:

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'HTML');
$objWriter->setSheetIndex($i);  //To output a specific sheet$objWriter->save('php://output');

Thanks!

Post a Comment for "Phpexcel Display Sheet(2) In Html"