I am using a ReportViewer and I would like to print my report.
When I click on the print button, a dialog box opens. It is similar to this.
I would like my program to skip this dialog and choose the default printer.
Is there a way to do one of the following things:
- Just skip the dialog box
- Map the print button to a function I wrote and that prints the report without showing the dialog box: something similar to
myButton.Click += new EventHandler(myButton_Click);
I checked MSDN but found nothing to alter the default toolbar.
I did find this discussion from 2006, where an answer basically says that it is not possible. Hiding the toolbar and creating my own would be a solution but it's a bit overkill.
I am also aware of How to print a ReportViewer's report without showing a form, but that's about being able to choose between showing the form and printing the report. This is not quite my problem because I do want to display the form, and I want that when I click on the Print button, it prints the report, without asking me which printer to use.