|
@@ -12,8 +12,23 @@ export class FinalTraineeReportComponent implements OnInit {
|
|
|
ngOnInit() {
|
|
|
}
|
|
|
|
|
|
- onPrint() {
|
|
|
- window.print();
|
|
|
- }
|
|
|
+ onPrint(): void {
|
|
|
+ let printContents, popupWin;
|
|
|
+ printContents = document.getElementById('print-section').innerHTML;
|
|
|
+ popupWin = window.open('', '_blank', 'top=0,left=0,height=100%,width=auto');
|
|
|
+ popupWin.document.open();
|
|
|
+ popupWin.document.write(`
|
|
|
+ <html>
|
|
|
+ <head>
|
|
|
+ <title>الإعتماد النهائي للمتدرب</title>
|
|
|
+ <style>
|
|
|
+ //........Customized style.......
|
|
|
+ </style>
|
|
|
+ </head>
|
|
|
+ <body onload="window.print();window.close()">${printContents}</body>
|
|
|
+ </html>`
|
|
|
+ );
|
|
|
+ popupWin.document.close();
|
|
|
+}
|
|
|
|
|
|
}
|