Forum Discussion

ChrisMac's avatar
ChrisMac
Contributor
14 years ago

Crystal Report dialog produces an exception if closed before fully invoked.

Hi -

I've got a Crystal Report dialog where if closed when not fully invoked will produce an exception. I'm using a While statement to wait for the report dialog to fully appear but apparently a statement like:



While Aliases.ReportViewerDialog.Exists <> True

 WEnd

ReportViewerDialog.Close



Will close the report dialog before it's fully invoked thus producing the exception. It seems that as soon as any part of that dialog appears then it is considered to "exist" even though either the outer dialog or the inner dialog

"Aliases.crystalReportViewer.PageView.TabControl.DocumentControl.PageControl" window hasn't fully invoked. 



My question is, is there a property like "FullyInvoked" for example that waits for either the dialog "ReportViewerDialog" or the inner dialog window "PageControl" to fully invoke before the dialog is closed? Thanks in advance.



Chris

1 Reply

  • Hi,



    Once an object appears in the tree, it exist, no matter what internal state it may have. How would you normally know that your report dialog loaded completely? Most probably, you need to wait for a specific value of one of its properties, or use other indication means. If so, you first need to obtain the dialog object or one of its children and wait for this property to have a specific value. Also, depending on how your dialog indicates that it is ready, you may need to, for example, wait until one of its child objects becomes visible or enabled.