Menu

Keep parameter window open after view report

kstan
2007-12-23
2013-03-08
  • kstan

    kstan - 2007-12-23

    Hi,
    Due to my users complain they need to keep re-open same report & re-input all the parameter, it consume a lot of their time. I'm digging the java source code about few hours, finally I figure out a way to keep the process (parameter) windows remain open. below is how i do it.

    1. edit client/src/org/compiere/apps/ProcessDialog.java
    2. go to line ~98, add this code 'private CCheckBox cReprosess = new CCheckBox();'   //we need it decide whether we want it remain open.
    3. Goto line ~162, add following code (to display it and checked it by default)
                    cReprosess.setText("Keep window.");
            cReprosess.setSelected(true);
            southPanel.add(cReprosess,null);
           
    4. Go to line ~355, change from

            if (m_IsReport && !pi.isError())
                bOK.doClick();
           
            // If the process is a silent one and no errors occured, close the dialog
            if(m_ShowHelp != null && m_ShowHelp.equals("S"))
                bOK.doClick();

    to

        if(cReprosess.isSelected()){
                bOK.setText(Msg.getMsg(Env.getCtx(), "Start"));
            }
            else
            {
            //
            afterProcessTask();
            //    Close automatically
            if (m_IsReport && !pi.isError())
                bOK.doClick();
           
            // If the process is a silent one and no errors occured, close the dialog
            if(m_ShowHelp != null && m_ShowHelp.equals("S"))
                bOK.doClick();
            }

    5. Test your report (so far I'd test with standard report & jasper report)

    * I test press 'complete' at sales order windows, seem like the check box won't display.
    * This method need some improvement, because it display the check box at both report & process, you'd been warn.

    Regards,
    Ks

     
    • Armen Rizal (Goodwill)

      Hi Ks,

      This is a good trick and think it's useful. I'll try it.

      Armen

       
    • Redhuan D. Oon

      Redhuan D. Oon - 2007-12-24

      Hi Kstan,
      Thanks for this. But next time can u post such tips to an easier place for users to find which is the Developer's forum instead of this Open Forum (as Open Forum is too busy)? Also your problems posts can also do them in the right sub forums? Thanks on that.

      You can also organise your tips in your wiki user page. I also reverted your company name post in the adempiere main wiki page. Pls use the world directory for malaysia instead. But pls place your company name in order at the bottom of the stack. Its a first come first placing plus some peer rating based on contribution that we rank companies placement.

      Any further clarification on this pls ask me.

      many regards
      red1

       

Log in to post a comment.