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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IsBusy (while report is loading)

Status
Not open for further replies.

crimsntyd

Programmer
Sep 27, 2005
55
US
Hi,
I'm using CR XI and VB 6 to load a report into CRViewer. The user of my app has many reports to choose from, but two summary reports take a long time (5 or 6 seconds) to load. I'd really like to show SOMETHING during this time while it's loading, but I don't know how, and I feel like I've tried everything. Here's my code so far:

Set CRApplication = New CRAXDRT.Application
Set CRReport = CRApplication.OpenReport(Rpt)
Set CRPrint = CRReport.PrintingStatus
CRReport.DisplayProgressDialog = True
frmReportViewer.Show
frmReportViewer.CRViewer.EnableProgressControl = True
frmReportViewer.CRViewer.DisplayGroupTree = False
frmReportViewer.CRViewer.EnableExportButton = True
frmReportViewer.CRViewer.Height = (frmReportViewer.Height - 200)
frmReportViewer.CRViewer.Width = (frmReportViewer.Width - 200)
frmReportViewer.CRViewer.ReportSource = CRReport
CRReport.EnableParameterPrompting = True
Select Case Rpt
Case CRPath + "Recycles.rpt"
CRReport.ParameterFields(1).ClearCurrentValueAndRange
CRReport.ParameterFields(1).AddCurrentValue LRU
Case CRPath + "Warranty.rpt"
CRReport.ParameterFields(1).ClearCurrentValueAndRange
CRReport.ParameterFields(1).AddCurrentValue LRU
Case CRPath + "MTBUR.rpt"
CRReport.ParameterFields(1).ClearCurrentValueAndRange
CRReport.ParameterFields(2).ClearCurrentValueAndRange
CRReport.ParameterFields(1).AddCurrentValue LRU
CRReport.ParameterFields(2).AddCurrentValue iRC
End Select
frmReportViewer.CRViewer.ViewReport
Do While frmReportViewer.CRViewer.IsBusy
DoEvents
Loop

...the select case code doesn't matter right now, because the summary report I'm trying to load doesn't need any parameters. At this point, all I get is a blank report screen for 5 or 6 seconds with no progress bar. I'd like to either show a progress bar or a message in the status bar of frmCoverPage (where the viewer is launched from) saying "retrieving data..." or something. Thanks in advance for the help.
 
Bad news: the RDC doesn't provide the expected printing status (how many records were read, for example), so you can't show the same status bar information that Crystal provides.

The approach I use in my viewer software is to show a message in the status bar and if the loading takes more than a certain amount of time (use a timer) I also show an animated gif.

Cheers,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Ok, that'll work, but how do I tell VB when to clear the message in the status bar? I'm not having any luck with the "isbusy" statement. I want to say status bar.text = "" when the report is finished loading. ??? Thanks for the info. I didn't realize that was a limitation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top