title: FastReport.Net : how to add Total in ReportSummaryBand dynamically
body: <p>I've written this part of code to add summary of the field "Count" to report summary band:</p>
  
  <pre><code>Total colTotal = CreateTotal();
  colTotal.SetReport(report);
  colTotal.PrintOn = reportSummaryBand;                
  TextObject colTitle = new TextObject();
  colTitle.Text="[" + colTotal.Name + "]";
  reportSummaryBand.Objects.Add(colTitle);
  </code></pre>
  
  <p>which CreateTotal function is as bellow:</p>
  
  <pre><code>private Total CreateTotal()
  {
      Total colTotal = new Total();
      colTotal.TotalType = TotalType.SUM, 
      columnHeader.Agg_Func_Type.ToString());
      colTotal.SetName("CountTotal");
      colTotal.Expression = "[MyTable.Count]";
      return colTotal;
  }
  </code></pre>
  
  <p>but i get the error :
    Error CS0103: The name 'CountTotal' does not exist in the current context</p>