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
I was using angular Cli with angular 8.2.1. Forgot to mention in previous email.
Thanks,
Srija P.
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
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.
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.
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.
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