asked
2014-10-28 17:41:46 +0800
rgravel 28 ● 5 Hi,
From a controller, I'm opening a new window to call a Jasper report. The problem it that new window (or tab depending of your browser) is blank when I choose an Excel format. I would like to close this window once the jasper/Excel is opened. How should I proceed to get the blank window closed? Or display teh Excel report in this new window?
Please note that for any other document type (PDF, HTML, etc.), the report is displayed in the new window/tab, which is ok.
Here's part of my code:
reports.java (controler)
Executions.getCurrent().sendRedirect("/app/rapport/displayReport.zul", "_blank");
displayReport.zul
<zk>
<jasperreport id="report" hflex="1" height="100%" width="100%"/>
<zscript><![CDATA[
import org.cic.common.container.SessContext;
import org.cic.fwd.ServiceLocator;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
SessContext sessContext = ServiceLocator.getSessContext();
report.setSrc((String)sessContext.get("src"));
report.setDatasource((JRBeanCollectionDataSource)sessContext.get("datasource"));
report.setParameters((Map)sessContext.get("parameters"));
report.setType((String)sessContext.get("type"));
]]></zscript>
</zk>