Skip to Content
avatar image
Former Member

how to catch the print event When user Clicks Print Button In Crystal Report Viewer?

i created a report using vb.net 2008 and crystal report viewer. if user print the report, I need to recored it.

user click on print button and print dialog show up with default print then user can click print or cancel.

in the report if user click print button, then program should wait for user next action?

if i print, vb debug does not go through? why? how to fix it inde?

thank you

'find the print button control and attach an event to it
                For Each Obj As Object In myToolStrip.Items
                    If TypeOf Obj Is ToolStripButton Then
                        'Adding a handler for our propose  
                        Dim b As ToolStripButton = CType(Obj, ToolStripButton)
                        If b.ToolTipText = "Print Report" Then
                            AddHandler CType(Obj, ToolStripButton).Click, AddressOf printButton_Click
                        End If

                    End If
                Next

Private Sub printButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)

        If updateReportStats Then

            Try

                    If Windows.Forms.DialogResult.OK Then
                        'Put your stuff here
                        UpdatePrintDate()
                        MessageBox.Show(" print")
                        'Else
                        'Windows.Forms.DialogResult.Cancel()
                    End If
               
            Catch ex As Exception

            End Try
        End If
       
    end sub

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 20, 2013 at 05:59 PM

    Hello Sunny

    Entering the search term 'event crystal net', in the search box in the top right corner of this web page returns the following KBA:

    1525043 - How to determine which button was clicked using Crystal Reports Winform Viewer click events

    Please see if the KBA helps. (Make sure you're on SP5 for CR 2008)

    - Ludek

    Follow us on Twitter

    Got Enhancement ideas? Try the SAP Idea Place

    Share Your Knowledge in SCN Topic Spaces

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Ludek Uher

      how can create own button?

      i can add button on report design, but it did not show in review. why?

      i can showprintbutton is false that works.