This is a migrated thread and some comments may be shown as answers.

Print Issue in Angular 8

6 Answers 332 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Srija
Top achievements
Rank 1
Srija asked on 26 Sep 2019, 01:07 PM

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.

6 Answers, 1 is accepted

Sort by
0
Srija
Top achievements
Rank 1
answered on 26 Sep 2019, 01:11 PM

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

 

Thanks,

Srija P.

0
Accepted
Silviya
Telerik team
answered on 27 Sep 2019, 07:57 AM

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
0
Srija
Top achievements
Rank 1
answered on 27 Sep 2019, 10:12 AM

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.

 

0
Srija
Top achievements
Rank 1
answered on 27 Sep 2019, 11:14 AM

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.

0
Srija
Top achievements
Rank 1
answered on 30 Sep 2019, 12:27 PM

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.

0
Todor
Telerik team
answered on 02 Oct 2019, 08:10 AM

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
Tags
General Discussions
Asked by
Srija
Top achievements
Rank 1
Answers by
Srija
Top achievements
Rank 1
Silviya
Telerik team
Todor
Telerik team
Share this question
or