title: How to show an informative real time progress data during long server process
body: <p>I have a so long process may take 1 hour .</p>
  
  <p>This process consists of many steps run from year to year .My main problem is :</p>
  
  <p>How to provide an informative real time progress to the end user during the process not just a dummy loading bar.</p>
  
  <pre><code>            int index = Convert.ToInt32(e.CommandArgument);
              bool done = false;
              int res = -1;
              int fromVal = int.Parse(gv_balance.Rows[index].Cells[0].Text);
              int toVal = int.Parse(gv_balance.Rows[index].Cells[1].Text);
              int finMonth = 1;
              int finYear = 0;
              int EndServ = 0;
              int calcYear = int.Parse(gv_balance.Rows[index].Cells[2].Text);
              int total;
              total = ((toVal - fromVal) + 1);
              string msg = string.Empty;
  
              int confirm = Balance.GetConfirmState(calcYear);
              if (confirm == 0)
              {
                  RadProgressContext progress = RadProgressContext.Current;
                  progress.Speed = "N/A";
  
                  finYear = fromVal;
  
                  for (int i = fromVal; i &lt;= toVal; i++)
                  {
                      decimal ratio;
                      //Load New Employees
                      if (toVal - fromVal &gt; 0)
                      {
                          ratio = ((decimal)toVal - i) / (toVal - fromVal) * 100;
                      }
                      else
                      {
                          ratio = ((decimal)toVal - i) / 1 * 100;
                      }
                      progress.PrimaryTotal = total;
                      progress.PrimaryValue = total;
                      progress.PrimaryPercent = 100;
  
                      progress.SecondaryTotal = 100; // total;
                      progress.SecondaryValue = ratio;//i ;
                      progress.SecondaryPercent = ratio; //i;
  
  
                      progress.CurrentOperationText = "Step " + i.ToString();
                      if (!Response.IsClientConnected)
                      {
                          //Cancel button was clicked or the browser was closed, so stop processing
                          break;
                      }
  
                      progress.TimeEstimated = (toVal - i) * 100;
                      //Stall the current thread for 0.1 seconds
                      System.Threading.Thread.Sleep(100);
                      EndServ = i + 1;
                      if (i == fromVal)
                      {   
                          //---&gt;STEP1
                          //Load intial data 
                          int intial = Balance.PrepareIntialData(calcYear);
                          //---&gt;STEP2
                          res = Balance.CalcEndServed(calcYear, EndServ - 1, 6, 30);
  
                      }
                       //---&gt;STEP3
                      int newEmps = Balance.PrepareNewEmployees(calcYear, i);
  
                      for (int j = 0; j &lt; 2; j++)
                      {
                          if (j == 0)
                          {
                              finMonth = 7;
                              finYear = i;
  
                          }
                          else
                          {
                              finMonth = 1;
                              finYear = i + 1;
                          }
                          //---&gt;STEP4
                          int promotion1 = Balance.PreparePromotionFirst(finYear, finMonth, calcYear);
                           //---&gt;STEP5
                          int promotion2 = Balance.PreparePromotionSecond(finYear, finMonth, calcYear);
                           //---&gt;STEP6
                          int appointment1 = Balance.PrepareAppointmentFirst(finYear, finMonth, calcYear);
                           //---&gt;STEP7
                          int appointment2 = Balance.PrepareAppointmentSecond(finYear, finMonth, calcYear);
  
                          //---&gt;STEP8
                          int bonus = Balance.PrepareBonus(finMonth, finYear, 0, calcYear);
  
                           //---&gt;STEP9
                          int salary = Balance.PrepareSalary(finYear, finMonth, calcYear);
                       (((CheckBox)gv_balance.Rows[index].Cells[3].FindControl("chk_redirect")).Checked == true)
                          {
                             //---&gt;STEP9
                              int acco = Balance.PrepareFinanceAccount(finYear, finMonth, calcYear);
                          }
  
                      }
  
  
                      //---&gt;STEP10
                      res = Balance.CalcEndServed(calcYear, EndServ, 6, 30);
                      Balance.CalcStudy(calcYear);
                      UpdateProgressContext();
                      if (res &lt; 0)
                      {
  
                          success_lb.Visible = false;
                          error_lb.Visible = true;
                          error_lb.Text = "ERROR";
  
                      }
                      else
                      {
                          done = true;
                          success_lb.Visible = true;
                          error_lb.Visible = false;
                          success_lb.Text = "Success";
                      }
  
  
                  }
              }
  </code></pre>
  
  <hr>
  
  <p>I want to show the current step for example :
  <code>(Promotion 1 ) in ---&gt; 1-2018</code> and the percentage of the whole process beside the estimated time .</p>