Hi team,
After the Google Chrome update 76.0.3809.132, the Print Report button of every of our Web Sites are no longer working. We have same problem with below ticket but we are using Xtrareport and reportviewer. Below solution is for documentviewer but we using reportviewer.
https://www.devexpress.com/Support/Center/Question/Details/T814122/aspxdocumentviewer-print-report-button-does-not-work-after-google-chrome-update-76-0
Kindly guide us to fix this. Thank you.
We have closed this ticket because another page addresses its subject:
ASPxDocumentViewer - Print Report button does not work after Google Chrome Update 76.0.3809.132Xtrareport - Print Report button does not work after Google Chrome Update 76.0.3809.132
Answers approved by DevExpress Support
Hello,
To resolve this issue with the ReportViewer control, use a workaround provided by Yong Xiang Tay in the ASPxDocumentViewer - Print Report button does not work after Google Chrome Update 76.0.3809.132 ticket. That is, handle the client-side ReportViewer.PageLoad event as follows:
JavaScriptfunction init(s) {
var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
var createFrameElement = s.printHelper.createFrameElement;
s.printHelper.createFrameElement = function (name) {
var frameElement = createFrameElement.call(this, name);
if(isChrome) {
frameElement.addEventListener("load", function (e) {
if (frameElement.contentDocument.contentType !== "text/html")
frameElement.contentWindow.print();
});
}
return frameElement;
}
}
ASPx<dx:ReportViewer ID="RepViewer" runat="server" PageByPage="True">
<ClientSideEvents PageLoad="init"/>
</dx:ReportViewer>