i am working on windows form application...i have a crystal report...for showing crystal report in button click event i given code like this:
SqlCommand cmdrslt = new SqlCommand("rptdeptwisevisitor", con.connect);
cmdrslt.CommandType = CommandType.StoredProcedure;
cmdrslt.Parameters.Add("@startDate", SqlDbType.NVarChar, 50, ParameterDirection.Input).Value = frmdateval;
cmdrslt.Parameters.Add("@endDate", SqlDbType.NVarChar, 50, ParameterDirection.Input).Value = Todateval;
SqlParameter tvp1 = cmdrslt.Parameters.AddWithValue("@Dept", DepTable);
tvp1.SqlDbType = SqlDbType.Structured;
tvp1.TypeName = "dbo.Dept";
da.SelectCommand = cmdrslt;
da.Fill(ds);
DeptWiseRpt rpt = new DeptWiseRpt();
if ((ds.Tables(0).Rows.Count > 0)) {
rpt.SetDataSource(ds.Tables(0));
rpt.SetParameterValue("frmd", setparmstartd);
rpt.SetParameterValue("tod", setparmendd);
CrystalReportViewer1.ReportSource = rpt;
}
this is taking time to load the data..so i want to put a progress bar on this form..how could I put it?
any help is very appreciable...