Hi,
I'm trying to open a report in Excel, with a specified dynamic filename
I have an xhtml page that spits out simple tabulated data. On viewing that page ID I call a method from pages.xml that does this:
String fileName="Charity_Report"+i+".xls"; HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse(); response.setContentType("application/vnd.ms-excel"); response.setHeader("Content-Disposition","attachment;filename=\"" + fileName + "\""); ctx.renderResponse();
// TODO This is such a hack it's untrue (closes response after 5s) maintenanceTasks.endResponse(5000L,ctx);