private void pShowEditFormula(String formula, out bool cancel) {
			cancel = false;
			try {

				cReportFormulaType f = null;
				cReportControl c = null;

				if (m_fFormula == null) { 
					m_fFormula = new fFormula();
					// TODO: set event handlers for fFormula
				}

				// TODO: this functionality has to be moved to fFormula
				//

				// Load formulas in the tree
				m_fFormula.createTree();

				for (int _i = 0; _i < m_report.getFormulaTypes().count(); _i++) {
					f = m_report.getFormulaTypes().item(_i);
					m_fFormula.addFormula(f.getId(), f.getName(), f.getNameUser(), f.getDecrip(), f.getHelpContextId());
				}

				for (int _i = 0; _i < m_report.getControls().count(); _i++) {
					c = m_report.getControls().item(_i);
					if (c.getControlType() == csRptControlType.CSRPTCTFIELD) {
						m_fFormula.addDBField(c.getName(), c.getField().getName());
					} 
					else if (c.getControlType() == csRptControlType.CSRPTCTLABEL) {
						m_fFormula.addLabel(c.getName());
					}
				}

				m_fFormula.setFormula(formula);

				m_fFormula.expandTree();

				m_fFormula.center();

				//
				// TODO: end functionality to move 

				m_fFormula.Show();

				cancel = !m_fFormula.getOk();

				if (!cancel) {
					formula = m_fFormula.getFormula();
				}

			} catch (Exception ex) {
				cError.mngError(ex, "m_fProperties_ShowEditFormula", C_MODULE, "");
			}
		}
        public bool showEditFormula(ref String formula) {

            try
            {
                cReportFormulaType f = null;
                cReportControl c = null;

                if (m_fFormula == null)
                {
                    m_fFormula = new fFormula();
                    // TODO: set event handlers for fFormula
                }

                // TODO: this functionality has to be moved to fFormula
                //

                // Load formulas in the tree
                m_fFormula.createTree();

                for (int _i = 0; _i < m_report.getFormulaTypes().count(); _i++)
                {
                    f = m_report.getFormulaTypes().item(_i);
                    m_fFormula.addFormula(f.getId(), f.getName(), f.getNameUser(), f.getDecrip(), f.getHelpContextId());
                }

                for (int _i = 0; _i < m_report.getControls().count(); _i++)
                {
                    c = m_report.getControls().item(_i);
                    if (c.getControlType() == csRptControlType.CSRPTCTFIELD)
                    {
                        m_fFormula.addDBField(c.getName(), c.getField().getName());
                    }
                    else if (c.getControlType() == csRptControlType.CSRPTCTLABEL)
                    {
                        m_fFormula.addLabel(c.getName());
                    }
                }

                m_fFormula.setFormula(formula);

                m_fFormula.setHandler(this);

                m_fFormula.expandTree();

                //
                // TODO: end functionality to move

                m_fFormula.ShowDialog();

                if (m_fFormula.getOk())
                {
                    formula = m_fFormula.getFormula();
                    return true;
                }
                else
                {
                    return false;
                }

            }
            catch (Exception ex)
            {
                cError.mngError(ex, "showEditFormula", C_MODULE, "");
                return false;
            }
            finally
            {
                m_fFormula.Hide();
                m_fFormula = null;
            }
        }