|
-
Jan 10th, 2001, 04:37 AM
#1
Thread Starter
Lively Member
I think this comes under the API juristiction.....
How can I catch the 'close' event from a Crystal Report viewer preview window? The help given in the Seagate help files doesn't help me much.
I do something like.....
Code:
Set crwApp = CreateObject("Crystal.crpe.application")
Set crReport = crwApp.OpenReport("D:\DVD Ordering System\Reports\DVD002.rpt")
Set repView = crReport.Preview
which is fine except that the viewer is not modal. I either want to be able to set the view to modal or loop until the viewer is closed by the user - but I don't know how to achieve either. The help does mention API calls but these examples aren't in VB, and I'm far too much of a cabbage to figure out how to translate them!
Anakim
It's a small world but I wouldn't like to paint it.
-
Jan 10th, 2001, 01:47 PM
#2
You can use the IsWindow API on the Views Parent's WindowHandle property, i.e.
Code:
Private Declare Function IsWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Sub cmdOpen_Click()
Set crwApp = CreateObject("Crystal.crpe.application")
Set crReport = crwApp.OpenReport("D:\DVD Ordering System\Reports\DVD002.rpt")
Set repView = crReport.Preview
While IsWindow(repView.Parent.WindowHandle)
DoEvents
Wend
MsgBox "Done"
End Sub
-
Jan 11th, 2001, 04:25 AM
#3
Thread Starter
Lively Member
Ta
Thanks Aaron, I'd got some assistance on this from another thread. Think Seagate should add a nicer interface to their viewer to allow this without API's though!
Anakim
It's a small world but I wouldn't like to paint it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|