Printing from Report Viewer - opens pdf

9 posts, 0 answers
  1. Tim
    Tim avatar
    17 posts
    Member since:
    Nov 2012

    Posted 25 Sep Link to this post

    There seems to be a recent change in how printing from the report viewer works. The used to open the print dialog and you could print from there. Now when you click print on the report viewer the browser prompts you to save as pdf.

    I've noticed this is happening on Telerik's demo page. 

    Is it a browser setting? Is anyone else having this issue?

    Thanks.

     

     

  2. James
    James avatar
    7 posts
    Member since:
    Aug 2012

    Posted 25 Sep in reply to Tim Link to this post

    Yes we are having the same issue after updating to Chrome 77, except it doesn't save as PDF and instead we just get a quick message that it's preparing the document, and then nothing happens.

     

    We took a machine with Chrome 76 installed, tested and verified that the functionality works correctly, then updated that same machine to Chrome 77, and the functionality was broken.  So Chrome 77 is definitely what broke it.

  3. Jose
    Jose avatar
    2 posts
    Member since:
    Aug 2013

    Posted 26 Sep Link to this post

    Having similar issue, latest chrome version (77) when hitting the print button, nothing happens. But on an older chrome version (76), It prompts users to print the Report. 

    Current Work around is just to have users export it out in PDF and then print from there.

    But would like to see if there is a work around or fix coming soon.

     

    Thank You.

  4. Tim
    Tim avatar
    17 posts
    Member since:
    Nov 2012

    Posted 26 Sep Link to this post

    If Chrome isn't prompting you to save you need to turn "Download PDF files instead of automatically opening them in Chrome" ON in the setting dialog.
  5. Silviya
    Admin
    Silviya avatar
    414 posts

    Posted 27 Sep Link to this post

    Hi Tim, James and Jose,

    This is an issue with the new version of Chrome (Chrome 77, pdf auto print dialog). We included a fix in our new R3 2019 release. The print button of the HTML5 Report Viewer now renders the report for print purposes and opens it in a new browser tab. The auto-print script is still embedded in the document, but Google Chrome will wait for user interaction in order to show its print dialog.

    The possible workarounds with the current version are two:

    1. This workaround was proposed by one of our users- check the post from Thanh in Print Dialog doesn't appear in Google Chrome 77.0.3865.75 thread. It allows you to trigger the print dialog on Print click. Our user Naumand updated it, so the same functionality is achieved in Firefox. Here are the required steps:

    • Add a reference to the Print.js third-party library in the viewer's page (above the reference to the viewer's JavaScript file).
    • Copy the telerikReportViewer-x.x.x.x.js file locally and refer it in the page from the local source. For example, if the viewer is copied to the folder "(base application folder)/ReportViewer" the references may look like:
    <head>
        ...
        <script src="https://printjs-4de6.kxcdn.com/print.min.js"></script>
        <script src="/ReportViewer/telerikReportViewer-13.2.19.918.js"></script>
       ...
    • Modify the code of the telerikReportViewer-x.x.x.x.js file - function printDesktop(src). Its original implementation is:
    function printDesktop(src) {
        window.open(src, "_blank");
    }

    Change it to:

    trv.printManager = function () {
       var iframe;
       function printDesktop(src) {
           if (window.navigator.userAgent.toLowerCase().indexOf("chrome") > -1) {
               printJS({ printable: src, type: 'pdf', showModal: true });
           } else {
               if (!iframe) {
                   iframe = document.createElement("IFRAME");
                   iframe.style = "position:absolute; left: -10000px; top: -10000px;";
               }
               iframe.src = src;
               document.body.appendChild(iframe);
           }
       }

    2. Setting FORCE_PDF_FILE printMode enumeration for the HTML5-based Report Viewers. This way, the widget will always export the report document to a PDF file which then could be printed.

    We are sorry for the inconvenience caused. Please test it and let us know how it goes.

    Best  Regards,
    Silviya
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Heorhi
    Heorhi avatar
    2 posts
    Member since:
    Apr 2015

    Posted 27 Sep in reply to Silviya Link to this post

    Hi Silviya,

    it works perfect (with print.js). Thanks.

  7. Heorhi
    Heorhi avatar
    2 posts
    Member since:
    Apr 2015

    Posted 27 Sep in reply to Silviya Link to this post

    More simple solution from  "Print Dialog doesn't appear in Google Chrome 77.0.3865.75" thread

    Just add:

    frame.contentWindow.focus();
    frame.contentWindow.print();

    after document.body.appendChild(frame);

     

    or 

    t.contentWindow.focus();t.contentWindow.print(); after t.src=e;o.body.appendChild(t); in telerikReportViewer.min.js

  8. Tim
    Tim avatar
    17 posts
    Member since:
    Nov 2012

    Posted 30 Sep in reply to Silviya Link to this post

    Thanks Silviya. Are you planning to provide a fix for the older WebForms viewer? I upgraded to R3 2019, but the WebForms viewer still has the problem.

    Thanks.

     

  9. Nasko
    Admin
    Nasko avatar
    1070 posts

    Posted 03 Oct Link to this post

    Hi Tim,

     

    The older WebForms viewer is no longer actively supported. However, you can still fix the Chrome print issue on your end by following the Workaround for the obsolete ASP.NET Web Forms Report Viewer.

     

    Regards,
    Nasko
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top