この問題の解決方法は簡単です。 ExtJsを使用しているので、あなたのコントローラはJavaScriptであると思います。
- 保存キーを使用してセッションのレポートは、(milesecondsで時間がかかることが)どんなPDF、XLSでレポート、
- リターンキーにを作成するために、Javaサーバの要求を行いますビューとは、あなたがCA XSLするダウンロードしたい場合は
新しいウィンドウがこのhttp://localhost:8080/myApplication/report?key=312312313
のようなURLが含まれている必要があり、レポートのためにサーバーを依頼する新しいウィンドウを開きますnはこれを試してみてください。
private void exportToExcel(HttpServletResponse resp, JasperPrint jasperPrint) throws IOException {
String reportfilename = tagreport("file") + "repor.xls";
JExcelApiExporter exporterXLS = new JExcelApiExporter();
exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT,jasperPrint);
exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE,Boolean.TRUE);
exporterXLS.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);
exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, resp.getOutputStream());
resp.setHeader("Content-Disposition", "inline;filename="+ reportfilename);
resp.setContentType("application/vnd.ms-excel");
try {
exporterXLS.exportReport();
} catch (JRException e) {
e.printStackTrace();
}
}
可能な重複:http://stackoverflow.com/questions/6365045/spring-mvc-3-0-jasper-reports-4-directing-html-reports-in-browser&HTTP ://stackoverflow.com/questions/7567660/inetgrating-ireportwith-large-no-of-sub-reports-with-spring-mvc&http://stackoverflow.com/questions/8239838/whats-the-best-way -to-show-html-reports-by-jasperreport-in-a-jsp –
別のリンク:http://stackoverflow.com/questions/4446666/how-to-set-up-jasper-reports-in- spring-with-subreports –