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:
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
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