问题
I have an rdlc report in an asp.net project.I’m using report viewer 10.0.0.0 to view and print the report. Except for Internet Explorer the print button of the report viewer does not show.
Though in my case, print button does show in IE, it gives the error” Unable to load client print control” when it is pressed. I found similar problems reported for report viewer 2008,but the solutions like, installing the SP 1 did not solved my problem.
Is there a way to enable printing independent of the browser?
Please Help.
回答1:
You can add your own button and adjust it to the report header and, using jquery and javascript you can print from chrome or firefox
For direct printing on page load:
$(window).load(function() {
var a = document.getElementById("ReportFrame" + reporviwername).contentWindow;
a[1].print();
});
For printing on PrintButton click:
$('.PrintButton').live('click', function() {
var a = document.getElementById("ReportFrame" + reporviwername).contentWindow;
a[1].print();
});
回答2:
The printer controls in report viewer are implemented as an ActiveX Control. Those are IE specific controls. So, you will not get that option if you use anything other than IE.
If you want a browser independent version, you could embed the report in pdf form. Pdfs viewers have a print button.
In my experience it works well with most modern browsers. The pdf format too is standard, so your reports will be printed the same, regardless of the browser.
回答3:
As everyone suggested that Report viewer control only renders with ActiveX control, and many other browsers don't support this so not possible but IE.
So Microsoft updates their supporting features in a recent release after SQL Server Reporting Service 2016 and later version they have updated their dependencies on ActiveX Control.
So you can update your Reporting Services to Latest. Refer :Updated Report Viewer Control
来源:https://stackoverflow.com/questions/11503352/printing-rdlc-using-report-viewer-10-0-0-0-print-button-not-showing