import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-final-trainee-report',
  templateUrl: './final-trainee-report.component.html',
  styleUrls: ['./final-trainee-report.component.css']
})
export class FinalTraineeReportComponent implements OnInit {

  constructor() { }

  ngOnInit() {
  }

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

}
