Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing cursor while Crystal Report opens

Status
Not open for further replies.

KerryC

Technical User
Apr 9, 2002
36
CA
Hi,

I have an application that I've written that accepts command line arguments and uses those arguments to load a particular report into an untyped ReportDocument, set parameters for the report and then shows the report in a CrystalReportViewer. It works fine, but a couple of the reports we're viewing can take 20 or 30 seconds to run before viewing. For those reports I want the cursor to change to an hourglass until the report is visible in the viewer, but I can't seem to get the cursor to change. The following is the code I've put into the form's load method:

Code:
[COLOR=green]'Change the cursor to an hourglass[/color]
[b]Cursor.Current = Cursors.WaitCursor[/b]


[i]... code to load the specified CR into the ReportDocument object, set up report parameters, connection info etc[/i]


crTables = ReportDocument1.Database.Tables

[COLOR=green]'Loop through each table in the report and apply the LogonInfo Information[/color]
For Each crTable In crTables
   crtableLogonInfo = crTable.LogOnInfo
   crtableLogonInfo.ConnectionInfo = crConnectionInfo
                crTable.ApplyLogOnInfo(crtableLogonInfo)
Next

[COLOR=green]'Set the viewer to the report object to be previewed[/color]
ReportViewer.ReportSource = ReportDocument1

[COLOR=green]'Change the cursor back[/color]
[b]Me.Cursor.Current = Cursors.Default[/b]

When I run this code it works ok and the report shows up in the viewer, but the cursor remains the default arrow and there's nothing to indicate to the user that the report is still loading. There must be some way to do this - can anyone point me in the right direction?

Thanks,
Kerry
 
me.cursor = cursors.waitcursor. works very well for me.

Christiaan Baes
Belgium

I just like this --> [Wiggle] [Wiggle]
 
Thanks Rick - I just tried and no luck. It seems I can set the cursor for the viewer control at design time to an hourglass, then stick

Me.Cursor = Cursors.WaitCursor

into the viewer control's Report_Refresh method, and the cursor will act as I want when it's sitting over the viewer, but I'd really like to have it be an hourglass anywhere over the whole form until the report shows.

Regards,
Kerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top