How do I Know When user click Print button on report screen.(What Event trigger when The print button was click.
Printable View
How do I Know When user click Print button on report screen.(What Event trigger when The print button was click.
I'm not sure if you have access to this in your Version of Crystal Reports, but in v7 you can reference the Crystal Report Engine Automation Server from which you can create a Window Object, (The Preview Screen for the Report), defining this WithEvent allows you to intercept the Preview Window Events..
You can also cancel the Default Action of the Event by setting UseDefault to False.Code:Private oCrystal As New CRPEAuto.Application
Private oReport As CRPEAuto.Report
Private WithEvents oWindow As CRPEAuto.Window
Private Sub Command1_Click()
Set oReport = oCrystal.OpenReport("C:\Report1.rpt")
Set oWindow = oReport.Preview("Report Title").Parent
End Sub
Private Sub oWindow_PrintButtonClicked(UseDefault As Boolean)
MsgBox "Print Clicked"
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Thank you so much Aaron Yong. I'll try.