Print Issue in Angular 8

7 posts, 1 answers
  1. Srija
    Srija avatar
    5 posts
    Member since:
    Sep 2017

    Posted 26 Sep Link to this post

    Hello Team,

    I got recently issue in printing the template using telerik-angular-report-viewer in Angular 8. It used to work untill day before yesterday suddenly it stopped working. Did any modules got changed to print the template?

    I'm using below code for print button:

    "<tr-viewer #viewer1 
        [containerStyle]="viewerContainerStyle"
        [serviceUrl]="ReportUrl"
        [templateUrl]="'node_modules/@progress/telerik-angular-report-viewer/dist/dependencies/telerikReportViewerTemplate-sass.html'"
        [reportSource]="Viewdata"
        [scaleMode]="'SPECIFIC'"
        [scale] = "1.0"
        [renderingEnd]="boundReportRendered"
        [error]="ReportError"
        [viewMode]="'PRINT_PREVIEW'">
        </tr-viewer>
        <button id='btnprint' style="display:none;" name='btnprint' (click)="viewer1.commands.print.exec()">Print</button>"

    Can you  please get back on the issue im facing!?

     

    Thanks in Advance.

    Thanks,

    Srija P.

  2. Srija
    Srija avatar
    5 posts
    Member since:
    Sep 2017

    Posted 26 Sep in reply to Srija Link to this post

    I was using angular Cli with angular 8.2.1. Forgot to mention in previous email.

     

    Thanks,

    Srija P.

  3. Answer
    Silviya
    Admin
    Silviya avatar
    414 posts

    Posted 27 Sep Link to this post

    Hi Srija,

    Please check my reply on the same topic in this forum thread: Printing from Report Viewer - opens pdf.

    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
  4. Srija
    Srija avatar
    5 posts
    Member since:
    Sep 2017

    Posted 27 Sep in reply to Silviya Link to this post

    Hello Silviya,

    Thanks for your quick response on this. 

    As you said i have added the code into my Project.

    Added reference Print.js third-party library. And modified the code for PrintDesktop as follows:

    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); } }

    I was getting an exception when click on print after adding code. Can you please check the attachment for error.

    Can you please get back on this issue!?

     

    Thanks in Advance.

     

    Thanks,

    Srija P.

     

  5. Srija
    Srija avatar
    5 posts
    Member since:
    Sep 2017

    Posted 27 Sep in reply to Silviya Link to this post

    Hello Silviya,

    Thanks for your answer. It helped me like a charm. Made my day. Thank you.

    Sorry that i haven't checked properly where the script print.js need to be placed. 

    It is working now. Thanks once again.

    Have a query on retrieving document message alert while getting the print popup. Is there any way to hide that message?

     

    Thanks,

    Srija P.

  6. Srija
    Srija avatar
    5 posts
    Member since:
    Sep 2017

    Posted 30 Sep Link to this post

    Hello Team,

    I have an issue with latest print dialog with whatever change you said me to implement with third-party library. I was able to get the print dialog but the original print default template was not coming i.e., Print and cancel need to be on left side and Data to be on Right side. It is getting in reverse.

     

    Is there any way to solve this issue?

    It would be pleasure if you come back with the answer on this.

     

    Thanks in Advance.

     

    Thanks,

    Srija P.

  7. Todor
    Admin
    Todor avatar
    397 posts

    Posted 02 Oct Link to this post

    Hi Srija,

    The Print Dialog in the browser comes from the application that opens the PDF report document generated by the Reporting tool. Usually, this is the browser PDF plug-in - check Printing Reports. Its appearance and behavior are beyond our control. You may test to add an extension for PDF view in Chrome, which Print Dialog suits your needs.

    Regards,
    Todor
    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