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!

Detecting Crystal Report Closing

Status
Not open for further replies.

freewilly

Programmer
Feb 19, 2001
43
AU
Hi Team

I building a report viewer. All it does is display reports generated by another application. The other application gives the reports the extension hzj. When the user clickes on a hzj file it fires my report viewer and displays the report.
The problem I have is that I can't detect the report being closed and hence report viewer does not close with the report.

Is there a way to detect the Crystal report being closed, like an Unload event? Or is there another way to deal with the problem?

I'm using the activeX control on a form and Crystal 7

Thanks

FW
 
Yes there is a way to do this but you will need to code it. You can use the FindWindow API function to return the window handle containing the preview, returns 0 if window can't be found hence, closed.

 
FW,

You don't say which language you are using for your application.

I have a little function called IsRunning() that tells you if a given window is open on the desktop (you use the text in the window's title bar to identify the window). It is written in Visual Foxpro. If it is of any use to you, you can grab a copy at:

If you don't use VFP, the same principles could be applied in other languages.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top