Ticket T823864
Visible to All Users

ReportViewer control stops working after adding the fix for the Chrome browser's printing

created 5 years ago (modified 5 years ago)

[DevExpress Support Team: CLONED FROM T818267: Print Report button does not work after Google Chrome Update]

Hello,
I have the same problem as Chandana has .  After adding the source code to my report.aspx page, my report page wouldn't load the report. Screenshot is attached.

ASPx
<dx:ReportViewer ID="InterimStatus_RegionFIViewer" runat="server" PageByPage="True"> <ClientSideEvents PageLoad="init"/> </dx:ReportViewer> <script type="text/javascript"> function 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; } } </script>

DevExpress.Web.v14.2, Version=14.2.3.0

Thanks,
Jen

Answers approved by DevExpress Support

created 5 years ago (modified 5 years ago)

Hi Jen,

In the code you provided, I see that the client-side event handler's script block seems to be defined below the ReportViewer control's definition. Note that the client-side function should be already declared on the web page above the DevExpress control where you use it. Check the Client-Side Events help topic for more information on how to handle client-side events.

So, move the <script> tag to the top of your web page or to its <head> section.

    Comments (2)

      Hi Vasily, thank you very much! Jen

      Vasily (DevExpress Support) 5 years ago

        You are always welcome, Jen!

        By the way, do you mind answering several questions regarding the applications in which you use our Reporting components?

        • For what kind of industry did you develop applications with the help of our Reporting products?
        • What kind of reports (table reports, interactive reports, sales reports, invoices, etc.) do you use in your applications?
        • Do you have any ideas on how we can improve our Reporting products to make them easier to use in the context of your applications? Maybe you have some feature requests?

        Your feedback will help us make our products better.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.