title: Using Javascript reportContext.setPersistentGlobalVariable method on Birt handlers
body: <p>I trying to use reportContext.setPersistentGlobalVariable to define global variable on the OnFetch Javascript method of the data set like that:</p>
  
  <pre class="lang-js prettyprint-override"><code>flag = 1;
  if(row.Percent&gt;10)
  reportContext.setPersistentGlobalVariable("flag", flag);
  </code></pre>
  
  <p>and to retrieve the variable on the beforeRender method like that:</p>
  
  <pre class="lang-js prettyprint-override"><code>var flg = reportContext.getPersistentGlobalVariable("flag");
  if(flg==1)
  reportContext.getDesignHandle().findElement("chartToHide").drop();
  </code></pre>
  
  <p>but by running the report receiving this error:</p>
  
  <blockquote>
    <p>org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "reportContext.setPersistentGlobalVariable("flag", true);":<br>
        Fail to execute script in function __bm_onFetch().</p>
  </blockquote>