fixes #32 Problem with advanced query on report viewer

http://hg.idempiere.com/idempiere/issue/32
This commit is contained in:
Carlos Ruiz 2011-06-06 22:50:03 -05:00
parent 2b11005fc8
commit 4b22df1f7d
3 changed files with 8 additions and 4 deletions

View File

@ -668,10 +668,10 @@ public final class MLookup extends Lookup implements Serializable
{ {
log.fine(m_info.KeyColumn + ": Loader NOT Validated: " + m_info.ValidationCode); log.fine(m_info.KeyColumn + ": Loader NOT Validated: " + m_info.ValidationCode);
// Bug 1843862 - Lookups not working on Report Viewer window // Bug 1843862 - Lookups not working on Report Viewer window
// globalqss - when called from Viewer window ignore error about unparsabe context variables // globalqss - when called from Viewer window ignore error about not parseable context variables
// there is no context in report viewer windows // there is no context in report viewer windows
//TODO: need different approach that is not client dependent boolean isReportViewer = Env.getContext(m_info.ctx, m_info.WindowNo, "_WinInfo_IsReportViewer").equals("Y");
if (Ini.isClient() == false /*|| !Env.getWindow(m_info.WindowNo).getClass().getName().equals("org.compiere.print.Viewer")*/) { if (!isReportViewer) {
m_lookup.clear(); m_lookup.clear();
return; return;
} }

View File

@ -151,6 +151,7 @@ public class Viewer extends CFrame
super(gc); super(gc);
log.info(""); log.info("");
m_WindowNo = AEnv.createWindowNo(this); m_WindowNo = AEnv.createWindowNo(this);
Env.setContext(re.getCtx(), m_WindowNo, "_WinInfo_IsReportViewer", "Y");
m_reportEngine = re; m_reportEngine = re;
m_AD_Table_ID = re.getPrintFormat().getAD_Table_ID(); m_AD_Table_ID = re.getPrintFormat().getAD_Table_ID();
if (!MRole.getDefault().isCanReport(m_AD_Table_ID)) if (!MRole.getDefault().isCanReport(m_AD_Table_ID))

View File

@ -39,6 +39,7 @@ import org.adempiere.webui.event.DrillEvent;
import org.adempiere.webui.event.ZoomEvent; import org.adempiere.webui.event.ZoomEvent;
import org.adempiere.webui.panel.StatusBarPanel; import org.adempiere.webui.panel.StatusBarPanel;
import org.adempiere.webui.report.HTMLExtension; import org.adempiere.webui.report.HTMLExtension;
import org.adempiere.webui.session.SessionManager;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.model.MArchive; import org.compiere.model.MArchive;
import org.compiere.model.MClient; import org.compiere.model.MClient;
@ -145,6 +146,8 @@ public class ZkReportViewer extends Window implements EventListener {
super(); super();
log.info(""); log.info("");
m_WindowNo = SessionManager.getAppDesktop().registerWindow(this);
Env.setContext(re.getCtx(), m_WindowNo, "_WinInfo_IsReportViewer", "Y");
m_reportEngine = re; m_reportEngine = re;
m_AD_Table_ID = re.getPrintFormat().getAD_Table_ID(); m_AD_Table_ID = re.getPrintFormat().getAD_Table_ID();
if (!MRole.getDefault().isCanReport(m_AD_Table_ID)) if (!MRole.getDefault().isCanReport(m_AD_Table_ID))
@ -512,7 +515,7 @@ public class ZkReportViewer extends Window implements EventListener {
*/ */
public void onClose() public void onClose()
{ {
Env.clearWinContext(m_WindowNo); SessionManager.getAppDesktop().unregisterWindow(m_WindowNo);
m_reportEngine = null; m_reportEngine = null;
m_ctx = null; m_ctx = null;
super.onClose(); super.onClose();