reportParameters.put(ORStatics.REPORT_DIR, new File(directoryProvider.getReportDirectory()));
//
reportLogProvider.insertReportLog(reportLog);
ReportEngineInput reportInput = new ReportEngineInput(report, reportParameters);
reportInput.setExportType(ExportType.findByCode(reportSchedule.getExportType()));
reportInput.setXmlInput(reportSchedule.getXmlInput());
reportInput.setLocale(reportSchedule.getLocale());
if (report.isJasperReport())
{
// add any charts
if (report.getReportChart() != null)
{
log.debug("Adding chart: " + report.getReportChart().getName());
ChartReportEngine chartEngine = new ChartReportEngine(
dataSourceProvider, directoryProvider, propertiesProvider);
ChartEngineOutput chartOutput = (ChartEngineOutput) chartEngine.generateReport(reportInput);
reportParameters.put("ChartImage", chartOutput.getContent());
}
if (report.isVirtualizationEnabled())
{
log.debug("Virtualization Enabled");
virtualizer = new JRFileVirtualizer(2, directoryProvider.getTempDirectory());
reportParameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);
}
reportInput.setParameters(reportParameters);
reportInput.setInlineImages(true);
}
ReportEngine reportEngine = ReportEngineHelper.getReportEngine(report,
dataSourceProvider, directoryProvider, propertiesProvider);
reportEngine.setApplicationContext(appContext);