cancel
Showing results for 
Search instead for 
Did you mean: 

CrystalReportViewer & Shortcut

patrick_simons2
Participant
0 Kudos

Hi,

is it possible to assign a shortcut f.ex. "CTRL-P" to the print toolbar button, to print out (with the dialog-window) what you see in the viewer, if as you have clicked the print button directly?

PS. I'm using CR 2008 SP4 with VS 2008 (RAS inproc)

Patrick

Accepted Solutions (1)

Accepted Solutions (1)

saurabh_pathak
Active Contributor
0 Kudos

This could be an enhancement idea.

Try the [SAP Idea Place|https://cw.sdn.sap.com/cw/community/ideas/businessanalytics/crystalreports]

-Saurabh

Edited by: Saurabh.Pathak on Dec 14, 2011 4:45 PM

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

Hello Pat

You could also create yor own button and implement this functionality. To add a button to the view, use the code below



Private Sub DoWork(ByVal sender As System.Object, ByVal e As System.EventArgs)        
	MessageBox.Show("Do your code here")    
End Sub 

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

	For Each ctrl As Control In CrystalReportViewer1.Controls
		If TypeOf ctrl Is Windows.Forms.ToolStrip Then
			Dim btnNew As New ToolStripButton
			btnNew.Text = "My Button"
			CType(ctrl, ToolStrip).Items.Add(btnNew)
			AddHandler ctrl.Click, AddressOf DoWork
		End If
	Next
End Sub


Patrick please do note that the above is a hack (e.g.; there are no public APIs for this as such). Also, the solution may be version specific. Last I fooled around with this was in Crystal Reports 11.5, so "stuff" may have changed since then.

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]