IDEMPIERE-214 - Schedular does not work with Jasper reports

(transplanted from f99f4696caa2faf52654c81630c7a7aac7fca3f3)
This commit is contained in:
Hesham S. Ahmed 2012-07-11 18:10:28 +03:00
parent bb8239152c
commit f7cf69bc60
1 changed files with 8 additions and 6 deletions

View File

@ -219,20 +219,22 @@ public class Scheduler extends AdempiereServer
File report = null;
if (isReport) {
// Report
if(process.getJasperReport() != null)
ReportEngine re = ReportEngine.get(m_schedulerctx, pi);
if(process.getJasperReport() != null
|| (re != null && re.getPrintFormat().getJasperProcess_ID() > 0))
{
// We have a Jasper Print Format
// ==============================
ProcessInfo jasperpi = new ProcessInfo ("", process.getAD_Process_ID());
jasperpi.setIsBatch(true);
ServerProcessCtl.process(null, jasperpi, null);
report = jasperpi.getPDFReport();
}
// Standard Print Format (Non-Jasper)
// ==================================
else
{
// We have a Jasper Print Format
// ==============================
ReportEngine re = ReportEngine.get(m_schedulerctx, pi);
// Standard Print Format (Non-Jasper)
// ==================================
if (re == null)
return "Cannot create Report AD_Process_ID=" + process.getAD_Process_ID()
+ " - " + process.getName();