FR [ 1842808 ] Allow pre-process to Jasper Reports
This commit is contained in:
parent
0ff2005591
commit
0867047eb3
|
@ -48,6 +48,8 @@ import org.compiere.wf.*;
|
||||||
*/
|
*/
|
||||||
public class ProcessCtl implements Runnable
|
public class ProcessCtl implements Runnable
|
||||||
{
|
{
|
||||||
|
private static final String JASPER_STARTER_CLASS = "org.compiere.report.ReportStarter";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process Control
|
* Process Control
|
||||||
* <code>
|
* <code>
|
||||||
|
@ -355,12 +357,21 @@ public class ProcessCtl implements Runnable
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear Jasper Report class if default - to be executed later
|
||||||
|
boolean isJasper = false;
|
||||||
|
if (JasperReport != null && JasperReport.trim().length() > 0) {
|
||||||
|
isJasper = true;
|
||||||
|
if (m_pi.getClassName().equals(JASPER_STARTER_CLASS)) {
|
||||||
|
m_pi.setClassName(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Start Optional Class
|
* Start Optional Class
|
||||||
*/
|
*/
|
||||||
if (m_pi.getClassName() != null)
|
if (m_pi.getClassName() != null)
|
||||||
{
|
{
|
||||||
if (JasperReport != null && JasperReport.trim().length() > 0)
|
if (isJasper)
|
||||||
{
|
{
|
||||||
m_pi.setReportingProcess(true);
|
m_pi.setReportingProcess(true);
|
||||||
}
|
}
|
||||||
|
@ -379,7 +390,7 @@ public class ProcessCtl implements Runnable
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// No Optional Report ... done
|
// No Optional Report ... done
|
||||||
if (IsReport && AD_ReportView_ID == 0)
|
if (IsReport && AD_ReportView_ID == 0 && ! isJasper)
|
||||||
{
|
{
|
||||||
unlock ();
|
unlock ();
|
||||||
return;
|
return;
|
||||||
|
@ -411,13 +422,14 @@ public class ProcessCtl implements Runnable
|
||||||
}
|
}
|
||||||
} // Pre-Report
|
} // Pre-Report
|
||||||
|
|
||||||
if (JasperReport != null && JasperReport.trim().length() > 0 && m_pi.getClassName() == null)
|
if (isJasper)
|
||||||
{
|
{
|
||||||
m_pi.setClassName("org.compiere.report.ReportStarter");
|
m_pi.setClassName(JASPER_STARTER_CLASS);
|
||||||
startProcess();
|
startProcess();
|
||||||
unlock();
|
unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start Report -----------------------------------------------
|
// Start Report -----------------------------------------------
|
||||||
boolean ok = ReportCtl.start(m_parent, windowno, m_pi, IsDirectPrint);
|
boolean ok = ReportCtl.start(m_parent, windowno, m_pi, IsDirectPrint);
|
||||||
m_pi.setSummary("Report", !ok);
|
m_pi.setSummary("Report", !ok);
|
||||||
|
|
Loading…
Reference in New Issue