Results 1 to 3 of 3

Thread: Print Button In Crystal Report

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Location
    Thailand
    Posts
    20

    Post

    How do I Know When user click Print button on report screen.(What Event trigger when The print button was click.

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    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..
    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
    You can also cancel the Default Action of the Event by setting UseDefault to False.

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 1999
    Location
    Thailand
    Posts
    20

    Post

    Thank you so much Aaron Yong. I'll try.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width