IDEMPIERE-16 Can report all users from "My Profile" window. Make report window to Inherit where clause from tab.

(transplanted from ed65734395b7e40d981da1c2f9050711c015455a)
This commit is contained in:
Heng Sin Low 2011-09-06 12:13:13 +08:00
parent 6e00887194
commit 51ed00a1ec
4 changed files with 26 additions and 3 deletions

View File

@ -71,6 +71,22 @@ public class WReport implements EventListener {
*/
public WReport (int AD_Table_ID, MQuery query, Component parent,
int WindowNo)
{
this(AD_Table_ID, query, parent, WindowNo, null);
}
/**
* Constructor
*
* @param AD_Table_ID table
* @param invoker component to display popup (optional)
* @param query query
* @param parent The invoking parent window
* @param WindowNo The invoking parent window number
* @param whereExtended
*/
public WReport (int AD_Table_ID, MQuery query, Component parent,
int WindowNo, String whereExtended)
{
log.config("AD_Table_ID=" + AD_Table_ID + " " + query);
if (!MRole.getDefault().isCanReport(AD_Table_ID))
@ -82,6 +98,7 @@ public class WReport implements EventListener {
m_query = query;
this.parent = parent;
this.WindowNo = WindowNo;
this.whereExtended = whereExtended;
// See What is there
getPrintFormats (AD_Table_ID);
@ -98,6 +115,8 @@ public class WReport implements EventListener {
Component parent;
/** The parent window number */
int WindowNo;
/** The filter to apply to this report */
private String whereExtended;
/**
* Get the Print Formats for the table.
@ -214,6 +233,8 @@ public class WReport implements EventListener {
{
// It's a default report using the standard printing engine
ReportEngine re = new ReportEngine (Env.getCtx(), pf, m_query, info);
re.setWhereExtended(whereExtended);
re.setWindowNo(WindowNo);
ReportCtl.preview(re);
}
} // launchReport

View File

@ -1843,7 +1843,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
infoName, infoDisplay);
}
new WReport (curTab.getAD_Table_ID(), query, toolbar.getEvent().getTarget(), curWindowNo);
new WReport (curTab.getAD_Table_ID(), query, toolbar.getEvent().getTarget(), curWindowNo, curTab.getWhereExtended());
}

View File

@ -1023,6 +1023,7 @@ public class FindWindow extends Window implements EventListener,ValueChangeListe
{
//
m_query = new MQuery(m_tableName);
m_query.addRestriction(Env.parseContext(Env.getCtx(), m_targetWindowNo, m_whereExtended, false));
StringBuffer code = new StringBuffer();
List<?> rowList = advancedPanel.getChildren();
@ -1304,6 +1305,7 @@ public class FindWindow extends Window implements EventListener,ValueChangeListe
{
// Create Query String
m_query = new MQuery(m_tableName);
m_query.addRestriction(Env.parseContext(Env.getCtx(), m_targetWindowNo, m_whereExtended, false));
if (hasValue && !fieldValue.getText().equals("%") && fieldValue.getText().length() != 0)
{
String value = fieldValue.getText().toUpperCase();

View File

@ -975,7 +975,7 @@ public class ZkReportViewer extends Window implements EventListener, ITabOnClose
bFind.setVisible(false);
else
{
FindWindow find = new FindWindow(m_WindowNo, title, AD_Table_ID, tableName,"", findFields, 1, AD_Tab_ID);
FindWindow find = new FindWindow(m_WindowNo, title, AD_Table_ID, tableName,m_reportEngine.getWhereExtended(), findFields, 1, AD_Tab_ID);
if (!find.isCancel())
{
m_reportEngine.setQuery(find.getQuery());