title: Crystal reports, sub-reports, and shared variables
body: <p>I have a formula @InitVars in the page header which includes the following, and similar lines: </p>
  
  <pre><code>shared numbervar runWaste:=0;
  </code></pre>
  
  <p>In Details v, I have a sub-report, which has a formula @SetRunWaste:</p>
  
  <pre><code>shared numbervar runWaste;
  if (OnFirstRecord) then
  (
  if not(isnull({x.x-or})) and 
  not(isnull({x.y-override})) and {x.y-override} = true then
  runWaste:={x.x-or} 
    else
  runWaste:= {x.x}
  );
  runWaste
  </code></pre>
  
  <p>I can see the output of this formula in the sub-report is 18.00.</p>
  
  <p>However, both in another sub-report, in Details az, and in the main report in Details w (as a test), I have the following formula @test:</p>
  
  <pre><code>shared numbervar runWaste;
  runWaste;
  </code></pre>
  
  <p>In both places, it shows as 0.00.</p>
  
  <p>Why is it showing 0 not 18?</p>
  
  <p>I'm using Crystal Reports version 11.0.0.895. </p>