Skip to Content

CrystalReportViewer & Shortcut

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Dec 14, 2011 at 03:43 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 14, 2011 at 05:33 PM

    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]

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.