I would like to make the print button in the web ReportViewer automatically print the report to the user's default printer, and also perform other actions based on the user printing the report. Can you please provide a code example that would allow me to do this?
Thanks!
Thanks!
4 Answers, 1 is accepted
0
Hello James,
We use the Adobe Plugin (if available) when printing and the user has the option to select the printer he would like to use. There is no way for us to know the default or all available printers a user has for security reasons. In order to perform other actions on click of the print button, you'll have to override the function like so:
Regards,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
We use the Adobe Plugin (if available) when printing and the user has the option to select the printer he would like to use. There is no way for us to know the default or all available printers a user has for security reasons. In order to perform other actions on click of the print button, you'll have to override the function like so:
<script type="text/javascript">Hope this helps.
ReportViewer.prototype.PrintReport = function()
{
//do your thing
this.PrintAs("Default");
}
</script>
Regards,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

James
Top achievements
Rank 2
answered on 10 Nov 2008, 05:13 PM
Steve,
I must be missing something. I put your code suggestion in my page and I keep getting a javascript error stating that "ReportViewer is undefined"
Here is my code:
I must be missing something. I put your code suggestion in my page and I keep getting a javascript error stating that "ReportViewer is undefined"
Here is my code:
<script type="text/javascript"> |
ReportViewer.prototype.PrintReport = function() { |
alert('Printing Report'); |
this.PrintAs("Default"); |
} |
</script> |
0
Accepted
Hi James,
Try adding the script block after the ReportViewer markup and see if that makes difference.
Best wishes,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Try adding the script block after the ReportViewer markup and see if that makes difference.
Best wishes,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

James
Top achievements
Rank 2
answered on 10 Nov 2008, 05:43 PM
Perfect Steve!!!!
Thanks for the help!
Thanks for the help!