Fix problem detected for [2815103] - Report is not inheriting the where from tab

https://sourceforge.net/tracker/?func=detail&atid=879332&aid=2815103&group_id=176962
This commit is contained in:
Carlos Ruiz 2009-09-30 22:47:41 +00:00
parent eb3e2b51bf
commit de2e2f3d17
2 changed files with 4 additions and 12 deletions

View File

@ -894,22 +894,12 @@ public final class APanel extends CPanel
if (query != null && query.isActive() && !role.isQueryMax(query.getRecordCount())) if (query != null && query.isActive() && !role.isQueryMax(query.getRecordCount()))
return query; return query;
// //
StringBuffer where = new StringBuffer(mTab.getWhereExtended()); StringBuffer where = new StringBuffer(Env.parseContext(m_ctx, m_curWindowNo, mTab.getWhereExtended(), false));
// Query automatically if high volume and no query // Query automatically if high volume and no query
boolean require = mTab.isHighVolume(); boolean require = mTab.isHighVolume();
if (!require && !m_onlyCurrentRows) // No Trx Window if (!require && !m_onlyCurrentRows) // No Trx Window
{ {
String wh1 = mTab.getWhereExtended(); /* Where Extended already appended above, check for variables */
if (wh1 == null || wh1.length() == 0)
wh1 = mTab.getWhereClause();
if (wh1 != null && wh1.length() > 0)
{
if (wh1.indexOf('@') == -1)
where.append(wh1);
else // replace variables
where.append(Env.parseContext(m_ctx, m_curWindowNo, wh1, false));
}
//
if (query != null) if (query != null)
{ {
String wh2 = query.getWhereClause(); String wh2 = query.getWhereClause();

View File

@ -109,6 +109,8 @@ public class AReport implements ActionListener
} }
m_query = query; m_query = query;
if (whereExtended != null && whereExtended.length() > 0 && m_query != null)
m_query.addRestriction(Env.parseContext(Env.getCtx(), WindowNo, whereExtended, false));
this.parent = parent; this.parent = parent;
this.WindowNo = WindowNo; this.WindowNo = WindowNo;
this.m_whereExtended = whereExtended; this.m_whereExtended = whereExtended;