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');
    }