if (jp.getPages().size() < 1) {
throw new ViewHandlerException("Report is Empty (no results?)");
} else {
Debug.logInfo("Got report, there are " + jp.getPages().size() + " pages.", module);
}
JRXlsExporter exporter = new JRXlsExporter();
exporter.setParameter(JRXlsExporterParameter.JASPER_PRINT, jp);
exporter.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, response.getOutputStream());
exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);
exporter.exportReport();
} catch (IOException ie) {
throw new ViewHandlerException("IO Error in report", ie);
} catch (java.sql.SQLException e) {
throw new ViewHandlerException("Database error while running report", e);