title: How to total Amount from group section header and footer in Crystal Reports
body: <p>Now this might be a very long to read, please read thoroughly..!</p>
  
  <p>I am creating a report in Crystal Report in Visual Studio 2015. Database is SQL Server 2014.</p>
  
  <p>Say, this is my data which the report uses, just for reference:</p>
  
  <p><a href="https://i.stack.imgur.com/2Rlmd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2Rlmd.png" alt="DataBase"></a></p>
  
  <p>I used the procedure for it, and I designed the procedure in such a way that if I insert date filter to procedure say of 02/05/2016 (DD/MM/YYYY) then the opening balance line displays on 02/05/2016.</p>
  
  <p>(Just explaining to make it easy, it is connected with the report).</p>
  
  <p>Now the following shows the structure of the report,</p>
  
  <p><a href="https://i.stack.imgur.com/jhS71.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jhS71.png" alt="Report Structure"></a></p>
  
  <p>I added description in Section 2 (Page Header) to display Opening Balance at the first of the report.<br> And I grouped the date monthly in it..<br>
  Following are the formulas I created in the report..</p>
  
  <ol>
  <li>DebitAmt/CreditAmt - To display amount in appropriate section from Database i.e Debit or Credit in the field.</li>
  <li><p>TotBal1 - Use to reset TotBal1 variable to 0 required for calculation, it is surpressed in section2 Page Header in Report Structure.</p>
  
  <p>Formula in TotBal1 contains:</p>
  
  <pre><code>WhilePrintingRecords;
  NumberVar TotBal1;
  TotBal1 := 0
  </code></pre></li>
  <li><p>TotBal3 - It contains addition formula.</p>
  
  <p>Formula in TotBal3 contains:
  <code>WhilePrintingRecords;
  NumberVar TotBal1;
  TotBal1 := TotBal1 - {@DebitAmt} + {@CreditAmt}</code></p></li>
  </ol>
  
  <p>This following displays the report.!</p>
  
  <p><a href="https://i.stack.imgur.com/jXUQU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jXUQU.png" alt="Report Output"></a></p>
  
  <blockquote>
    <p>Problems facing are mentioned below..</p>
  </blockquote>
  
  <ol>
  <li>Now the problem is in Image 3, I am not getting the balance by placing TotBal3, it shows 0. I question Marked there with blue ink.</li>
  <li>The summation at the end of the report doesn't include the 9502.53 Amount value (circled with blue ink below). I want to add that even in that total. Exact figure should be 53367.53.....</li>
  </ol>
  
  <p>I have created that sum by in built summation tool in crystal report..
  Please say if anything more required...!</p>