Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

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

$
0
0

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


Viewing all articles
Browse latest Browse all 3636

Trending Articles