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

Trap Data Report print button events 1

Status
Not open for further replies.

genomon

Programmer
Aug 20, 2001
2,449
US
Using VB6 SP6. The open data report is displayed in a container that has a print button in the caption bar.
I need to know when that button is used, but can't find a way of getting at it. Anyone know how to trap its click event? Maybe an API?

Silence is golden.
Duct tape is silver.
 
I do not use the DataReport...just played around with it...so I am not sure if the following will work, but by the sound of it, it should, somewhat:

There is an AsyncProgress event available (from the dropdowns in the code window), and there are arguments which identify which of three processes are taking place, and one of them is whether the report is printing (JobType=rptAsyncPrint).
And there are two arguments concerning the page numbers: One which identifies the current page completed(PageCompleted) and one which identifies the total page count being processed (TotalPages).

So, when the JobType=rptAsyncPrint and PageCompleted=1, the process job has started.

And, when the JobType=rptAsyncPrint and PageCompleted=TotalPages, then the process job is completed.
 
Thanks SBerthold! I'll give it a try. I have users that like to minimize the DR after printing from preview - when they exit the app the report still hangs and need to get rid of it. I hereby bestow a star upon thee....

Silence is golden.
Duct tape is silver.
 
Worked like a charm. How simple can it get? :
If PageCompleted = TotalPages Then
Unload Me
End If


Silence is golden.
Duct tape is silver.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top