[2815103] - Report is not inheriting the where from tab

https://sourceforge.net/tracker/?func=detail&atid=879332&aid=2815103&group_id=176962
Fix problem detected when reporting from Reference -> Used in Column Tab
This commit is contained in:
Carlos Ruiz 2009-09-30 23:37:09 +00:00
parent de2e2f3d17
commit 72d335281c
4 changed files with 15 additions and 2 deletions

View File

@ -627,7 +627,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
// we have column and value
if (where.length() != 0)
where.append(" AND ");
where.append(lc).append("=");
where.append(getTableName()).append(".").append(lc).append("=");
if (lc.endsWith("_ID"))
where.append(value);
else

View File

@ -160,6 +160,8 @@ public class ReportEngine implements PrintServiceAttributeListener
private String m_trxName = null;
/** Where filter */
private String m_whereExtended = null;
/** Window */
private int m_windowNo = 0;
/**
* Set PrintFormat.
@ -1581,5 +1583,15 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
public String getWhereExtended() {
return m_whereExtended;
}
/* Save windowNo of the report to parse the context */
public void setWindowNo(int windowNo) {
m_windowNo = windowNo;
}
public int getWindowNo() {
return m_windowNo;
}
} // ReportEngine

View File

@ -237,6 +237,7 @@ public class AReport implements ActionListener
// It's a default report using the standard printing engine
ReportEngine re = new ReportEngine (Env.getCtx(), pf, m_query, info);
re.setWhereExtended(m_whereExtended);
re.setWindowNo(WindowNo);
ReportCtl.preview(re);
}
} // launchReport

View File

@ -1158,7 +1158,7 @@ public class Viewer extends CFrame
bFind.setEnabled(false);
else
{
Find find = new Find (this, m_WindowNo, title,
Find find = new Find (this, m_reportEngine.getWindowNo(), title,
AD_Tab_ID, AD_Table_ID, tableName, m_reportEngine.getWhereExtended(), findFields, 1);
m_reportEngine.setQuery(find.getQuery());
find.dispose();