how can i use javascript after download excel ?

Topics: User Forum
Aug 29, 2012 at 1:35 PM
Edited Aug 29, 2012 at 1:43 PM


phpexcel export and download file take a long time.
so, i want display waiting dialog. like this...

    alert ( "download start.." );
    header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
    header('Content-Disposition: attachment;filename="' . "test.xlsx". ';"' );
    header('Cache-Control: max-age=0');
   // take a long time job.
    $objWriter = PHPExcel_IOFactory::createWriter($this->_objPHPExcel, 'Excel2007');
    alert ( "download completed !!" );

but, "test.xlsx" file is corrupted.
$objWriter->save('php://output');   <<=   good work when this line comments.

I want show waiting information( progress bar, waiting dialog, etc ) to user  while phpexcel work and download.

Thank you.

Aug 31, 2012 at 1:00 PM

See my response here :

Don't permit a progress bar, but a accurate 'please wait'.

IMHO, using alert() for this is not very nice... and, in my case, downloading the file is quick, but building the file take some time.