How to load or display a specific sheet in the browser

Topics: User Forum
May 9, 2013 at 8:46 AM
Hi there, I just recently used PHPExcel and I want to know how to display an excel file into the browser as an HTML. I have succeeded in displaying the first sheet of an excel file but I also want to know how am I going to display the other sheets as well.

Here is my code:
             include 'bundles/laravel-phpexcel/PHPExcel/IOFactory.php';

    $inputFileType = 'Excel2007';
    $inputFileName = 'sampleData/test.xlsm';

    $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'HTML');
    $objWriter->save('php://output');
    exit;
I hope you guys can help me. Thanks in advance! :)
Coordinator
May 9, 2013 at 9:12 AM
Call theHTML Writers writeAllSheets() method before saving:
$objWriter->writeAllSheets();
May 9, 2013 at 9:23 AM
Thanks, you're a great help. :)