/** * {@inheritDoc} */ @Override public JRDataSource evaluate(ReportParameters reportParameters) { return new JREmptyDataSource(count); }
private JRDataSource createDataSource() { return new JREmptyDataSource(2); } }
private JRDataSource createDataSource() { return new JREmptyDataSource(5); }
private JRDataSource createDataSource() { return new JREmptyDataSource(3); }
/** * Get grid data * @return ReportGrid data */ public JRDataSource getDataSource() { if (fields == null || data == null || data.isEmpty()) { return new JREmptyDataSource(); } // Generate datasource fields DRDataSource dataSource = new DRDataSource(fields.toArray(new String[fields.size()])); for (List<Object> row : data) { // Fill datasource with data dataSource.add(row.toArray(new Object[row.size()])); } return dataSource; }
private JRDataSource getDataSource(Report report) { if (report.getData() != null) return new JRBeanCollectionDataSource(report.getData(), false); else if (!report.getParameters().containsKey(Connection.class.getName())) { logger.warn("You are willing to generate a report, but there is no valid datasource, using empty one"); return new JREmptyDataSource(); } return null; }
JasperFillManager.fillReportToFile(jasperReport, outputFileName, reportParms, new JREmptyDataSource()); } else { throw new ReportException("No suitable datasource configured for report " + reportId);
JasperFillManager.fillReportToFile(jasperReport, outputFileName, reportParms, new JREmptyDataSource()); } else { throw new ReportException("No suitable datasource configured for report " + reportId);
@Override public Void call() throws Exception { final JasperReport jasperReport = getJasperReport(reportId); final Map<String, Object> jrReportParms = buildJRparameters(reportParms, jasperReport.getParameters()); jrReportParms.putAll(buildSubreport(reportId, jasperReport)); if ("jdbc".equalsIgnoreCase(m_globalReportRepository.getEngine(reportId))) { final DBUtils db = new DBUtils(); try { final Connection connection = DataSourceFactory.getInstance().getConnection(); db.watch(connection); final JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, jrReportParms, connection); exportReport(format, jasperPrint, outputStream); } finally { db.cleanUp(); } } else if ("null".equalsIgnoreCase(m_globalReportRepository.getEngine(reportId))) { final JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, jrReportParms, new JREmptyDataSource()); exportReport(format, jasperPrint, outputStream); } return null; } });
jrDataSource = new JREmptyDataSource();
@Override public Void call() throws Exception { final JasperReport jasperReport = getJasperReport(reportId); final Map<String, Object> jrReportParms = buildJRparameters(reportParms, jasperReport.getParameters()); jrReportParms.putAll(buildSubreport(reportId, jasperReport)); if ("jdbc".equalsIgnoreCase(m_globalReportRepository.getEngine(reportId))) { final DBUtils db = new DBUtils(); try { final Connection connection = DataSourceFactory.getInstance().getConnection(); db.watch(connection); final JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, jrReportParms, connection); exportReport(format, jasperPrint, outputStream); } finally { db.cleanUp(); } } else if ("null".equalsIgnoreCase(m_globalReportRepository.getEngine(reportId))) { final JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, jrReportParms, new JREmptyDataSource()); exportReport(format, jasperPrint, outputStream); } return null; } });
if (dataSource == null) dataSource = new JREmptyDataSource();
if (dataSource == null) dataSource = new JREmptyDataSource();
_datasource != null ? _datasource: new JREmptyDataSource());
private void build() { try { report().setTemplate(Templates.reportTemplate) .setPageColumnsPerPage(2) .setPageColumnSpace(10) .columns(col.reportRowNumberColumn("Report row"), col.pageRowNumberColumn("Page row"), col.columnRowNumberColumn("Page column row")) .title(Templates.createTitleComponent("RowNumberColumns")) .pageFooter(Templates.footerComponent) .setDataSource(new JREmptyDataSource(150)) .show(); } catch (DRException e) { e.printStackTrace(); } } }