Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am fetching data from crystal report to report viewer. It takes time to show the report.
I want to show a wait cursor while loading data. I am trying to override IsLoad() method. I fail to implement it. If any one knows, then kindly help me.
C#
if (cmb_Status.Text == "Occupied")
           {
               OleDbDataAdapter adapter = new OleDbDataAdapter("select * from tbl_Bed where Status='Occupied'", con);
               DataSet dss = new DataSet();
               adapter.Fill(dss, "tbl_Bed");
               if (dss.Tables["tbl_Bed"].Rows.Count > 0)
               {
                   JeevanDeep.Report.ReportBedStatus bed = new JeevanDeep.Report.ReportBedStatus();
                   bed.SetDataSource(dss);
                   crystalReportViewer1.ReportSource = bed;
                   crystalReportViewer1.Zoom(50);

               }
           }

Thanks and regards,
Arshad
Posted
Updated 7-Jan-11 22:33pm
v2

Use the Cursor property. that's all.
C#
if (cmb_Status.Text == "Occupied")
{
OleDbDataAdapter adapter = new OleDbDataAdapter("select * from tbl_Bed where Status='Occupied'", con);
DataSet dss = new DataSet();
adapter.Fill(dss, "tbl_Bed");
if (dss.Tables["tbl_Bed"].Rows.Count > 0)
{
this.Cursor = Cursors.WaitCursor;//Wait Cursor
JeevanDeep.Report.ReportBedStatus bed = new JeevanDeep.Report.ReportBedStatus();
bed.SetDataSource(dss);
crystalReportViewer1.ReportSource = bed;
crystalReportViewer1.Zoom(50);
this.Cursor = Cursors.Default;//Default Cursor
}
}
 
Share this answer
 
if (cmb_Status.Text == "Occupied")
{
     Cursor = Cursors.WaitCursor;
     
OleDbDataAdapter adapter = new OleDbDataAdapter("select * from tbl_Bed where Status='Occupied'", con);
DataSet dss = new DataSet();
adapter.Fill(dss, "tbl_Bed");
if (dss.Tables["tbl_Bed"].Rows.Count > 0)
{
JeevanDeep.Report.ReportBedStatus bed = new JeevanDeep.Report.ReportBedStatus();
bed.SetDataSource(dss);
crystalReportViewer1.ReportSource = bed;
crystalReportViewer1.Zoom(50);

}
Cursor = Cursors.Default;
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900