How can I show the progress of the CrystalReportViewer in C#?

I have a small client application written in C# (Visual Studio 2003), which contains a CrystalReportViewer component to display some reports.
The database has grown over the years and now it takes several minutes before these reports are displayed. My customers have complained that during the execution of a report, it's not very clear if the program is still running.

I tried to include the WaitCursor (see the code sample), but as soon as the Crystal Reports Database Login appears the cursor is normal again.
Is there any way to have either a WaitCursor or some kind of progressbar during the execution of the report?
string workDir = System.IO.Directory.GetCurrentDirectory();
 
this.Cursor = Cursors.WaitCursor;
			
if (rbOE.Checked)
{
	crv.ReportSource = workDir + @"\Sectieoverzicht.rpt";
}
 
else
{
	crv.ReportSource = workDir + @"\Geaggregeerd Sectieoverzicht PSA.rpt";
}
 
this.Cursor = Cursors.Default;

Open in new window

LVL 12
RubenvdLindenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SwissKnifeCommented:
Hello RubenvdLinden

I think, you do all in one step.

May be you can show the wait cursor if you break up the loading and displaying as described in the linked article:
http://www.c-sharpcorner.com/UploadFile/mahesh/CrystalReportsViewer11082005044859AM/CrystalReportsViewer.aspx
0
RubenvdLindenAuthor Commented:
Thank you for your response. I have changed my code and now it uses a ReportDocument object as the ReportSource.
Unfortunately, I get the same results.

Is there some kind of event that is triggered whenever a report is loaded? It might be of use to me.


this.Cursor = Cursors.WaitCursor;
			
if (rbOE.Checked)
{
		//crv.ReportSource = new Reports.Sectieoverzicht();
		//crv.ReportSource = workDir + @"\Sectieoverzicht.rpt";
		doc.Load(workDir + @"\Sectieoverzicht.rpt");
}
 
else
{
		//crv.ReportSource = new Reports.Geaggregeerd_Sectieoverzicht_PSA();
		//crv.ReportSource = workDir + @"\Geaggregeerd Sectieoverzicht PSA.rpt";
		doc.Load(workDir + @"\Geaggregeerd Sectieoverzicht PSA.rpt");
}
			
crv.ReportSource = doc;
			
this.Cursor = Cursors.Default;

Open in new window

0
mlmccCommented:
As far as I know there is no event that indicates load is complete.  This has been asked many times in different ways and there has been no solution.

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

RubenvdLindenAuthor Commented:
Thanks for the responses.
I will try if the WaitCursor works if I manually program the reportlogon to the database rather than using the Crystal Reports dialog.
0
RubenvdLindenAuthor Commented:
I tried to logon the report to the database through code, but again the WaitCursor changed into the DefaultCursor as soon as the logon succeeded.

If I do not receive any other suggestions this week, I will accept the answer of mlmcc. In this case "There is no solution" might be the correct answer.
0
RubenvdLindenAuthor Commented:
I'm glad I can stop searching for a solution which does not exists. Thank you for your time.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.