Connecting Tech Pros Worldwide Help | Site Map

How insert a progressbar while the crystalreport raise my report?

Newbie
 
Join Date: Oct 2009
Posts: 8
#1: 3 Weeks Ago
Expand|Select|Wrap|Line Numbers
  1.  
  2.         private void button5_Click(object sender, EventArgs e)
  3.         {           
  4.             DataSet ds = new DataSet();
  5.             string sSql = @"SELECT * FROM r_Residents WHERE rActiveOrNot = '" + "False" + "' AND rResidentOrNot = '" + "HOUSE" + "'";
  6.             SqlParameter[] parameters = new SqlParameter[0];
  7.             try
  8.             {
  9.                 ds = DataAccess.ExecuteDataset(cn, CommandType.Text, sSql, parameters);
  10.                 int count = ds.Tables[0].Rows.Count;
  11.                 ResidentDebtor1 objRpt = new ResidentDebtor1();
  12.                 objRpt.SetDataSource(ds.Tables[0]);
  13.                 crystalReportViewer1.ReportSource = objRpt;
  14.                 crystalReportViewer1.Refresh();                   
  15.             }
  16.             catch (Exception ex)
  17.             {
  18.                 MessageBox.Show("0 Records where found due to an error: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  19.             }
  20.         }
  21.  
MrMancunian's Avatar
Expert
 
Join Date: Jul 2008
Location: Utrecht, The Netherlands
Posts: 274
#2: 3 Weeks Ago

re: How insert a progressbar while the crystalreport raise my report?


Add a progressbar to your Form, start it (or make it visible) when you begin raising your report and stop it (or make it invisible) when loading the report is done. There are a few different ways to use the ProgressBar. Read this MSDN topic on the ProgressBar.

Steven
Reply