public function output($filename = 'excel.xls', $excelWriterType = 'Excel2007')
    {
        if (!$this->phpexcel instanceof \PHPExcel) {
            throw new HtmlPhpExcelException('You must run process() first to create a phpexcel instance');
        }

        header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
        header('Content-Disposition: attachment;filename="'.$filename.'"');
        header('Cache-Control: max-age=1');

        $writer = \PHPExcel_IOFactory::createWriter($this->phpexcel, $excelWriterType);
        $writer->save('php://output');
    }
public function output($filename = 'excel.xls', $excelWriterType = 'Excel2007')
    {
        if (!$this->phpexcel instanceof \PHPExcel) {
            throw new HtmlPhpExcelException('You must run process() first to create a phpexcel instance');
        }

        header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
        header('Content-Disposition: attachment;filename="'.$filename.'"');
        header('Cache-Control: max-age=1');

        $writer = \PHPExcel_IOFactory::createWriter($this->phpexcel, $excelWriterType);
        $writer->save('php://output');
    }
public function output ( $ filename = 'excel.xls' , $ excelWriterType = 'Excel2007' ) { if ( ! $ this -> phpexcel instanceof \ PHPExcel ) { throw new HtmlPhpExcelException ( 'You must run process() first to create a phpexcel instance' ) ; } header ( 'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ) ; header ( 'Content-Disposition: attachment;filename="' . $ filename . '"' ) ; header ( 'Cache-Control: max-age=1' ) ; $ writer = \ PHPExcel_IOFactory :: createWriter ( $ this -> phpexcel , $ excelWriterType ) ; $ writer -> save ( 'php://output' ) ; }
Output the created excel file

@param string $filename The name of the output file
@param string $excelWriterType Excel file type
@throws Exception\HtmlPhpExcelException
Output the created excel file