/** * Generate the report * * @param output * @param stream * @param report * @param acceptedPage * @param query2 * @throws Exception */ private void generateHtmlReport( MasterReport output, OutputStream stream, Map<String, Object> reportParameters, HtmlReport report, Integer acceptedPage) throws Exception { final SimpleReportingComponent reportComponent = prptManager.getReportingComponent(); reportComponent.setReport(output); reportComponent.setPaginateOutput(true); reportComponent.setInputs(reportParameters); reportComponent.setDefaultOutputTarget(HtmlTableModule.TABLE_HTML_PAGE_EXPORT_TYPE); reportComponent.setOutputTarget(HtmlTableModule.TABLE_HTML_PAGE_EXPORT_TYPE); reportComponent.setDashboardMode(true); reportComponent.setOutputStream(stream); reportComponent.setAcceptedPage(acceptedPage); // reportComponent.setUseContentRepository(false); reportComponent.validate(); reportComponent.execute(); report.setCurrentPage(reportComponent.getAcceptedPage()); report.setPageCount(reportComponent.getPageCount()); }
/** * Generate the report * * @param output * @param stream * @param report * @param acceptedPage * @param query2 * @throws Exception */ private void generatePdfReport( MasterReport output, OutputStream stream, Map<String, Object> reportParameters) throws Exception { final SimpleReportingComponent reportComponent = new SimpleReportingComponent(); reportComponent.setReport(output); reportComponent.setPaginateOutput(true); reportComponent.setInputs(reportParameters); reportComponent.setDefaultOutputTarget(PdfPageableModule.PDF_EXPORT_TYPE); reportComponent.setOutputTarget(PdfPageableModule.PDF_EXPORT_TYPE); reportComponent.setOutputStream(stream); reportComponent.validate(); reportComponent.execute(); }