windows popup close before display dos . xls

Posted by Edgar Trejo on Stack Overflow See other posts from Stack Overflow or by Edgar Trejo
Published on 2012-06-27T15:08:04Z Indexed on 2012/06/27 15:16 UTC
Read the original article Hit count: 196

Good morning!

I'm trying to display a document. Xls in a popup window on IE8 but before showing the window closes automatically.

Here I show the code

javascript:

function hacerExportarExcel(){
   var url = contextPath + "/exportarCarteraCreditoExcel.do"
   window.setTimeout("window.open('"+url+"', '_blank', 'width=950,height=500,scrollbars=yes')",1000);

}

action:

try {

    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "inline; filename=ConsultaCartera.xls");       
    consulta.setPdf(response.getOutputStream());
    administracionCreditoConsulta.exportarCarteraCreditoExcel(consulta); 

} catch (Exception e) {

    logger.logError(e);

} finally {

    response.getOutputStream().flush();
    response.getOutputStream().close();

}

Can someone please help me!

Thanks!

© Stack Overflow or respective owner

Related posts about excel

Related posts about internet-explorer-8