IDEMPIERE-3559 DrillDown report didn't work because of two bug / integrate suggestions from Denis Kuznetsov

This commit is contained in:
Carlos Ruiz 2017-11-15 10:46:11 +01:00
parent fbb260a1ea
commit b689ad0495
2 changed files with 15 additions and 3 deletions

View File

@ -167,8 +167,20 @@ public class WReport implements EventListener<Event> {
private void launchReport (MPrintFormat pf) private void launchReport (MPrintFormat pf)
{ {
int Record_ID = 0; int Record_ID = 0;
if (m_query.getRestrictionCount()==1 && m_query.getCode(0) instanceof Integer) if (m_query.getRestrictionCount() == 1) {
if (m_query.getColumnName(0).equals(m_query.getTableName()+"_ID")) {
Object vrec = m_query.getCode(0);
if (vrec instanceof Integer) {
Record_ID = ((Integer)m_query.getCode(0)).intValue(); Record_ID = ((Integer)m_query.getCode(0)).intValue();
} else {
try {
Record_ID = Integer.parseInt(m_query.getCode(0).toString());
} catch (NumberFormatException e) {
log.info(e.getMessage());
}
}
}
}
PrintInfo info = new PrintInfo( PrintInfo info = new PrintInfo(
pf.getName(), pf.getName(),
pf.getAD_Table_ID(), pf.getAD_Table_ID(),

View File

@ -996,7 +996,7 @@ public class ZkReportViewer extends Window implements EventListener<Event>, ITab
return; return;
} }
if (AD_Table_ID != 0) if (AD_Table_ID != 0)
new WReport (AD_Table_ID, query, component, 0); new WReport (AD_Table_ID, query, component, m_WindowNo);
else else
log.warning("No Table found for " + query.getWhereClause(true)); log.warning("No Table found for " + query.getWhereClause(true));
} // executeDrill } // executeDrill