0

Bellow I have attach my code.

I am trying to print the excel file using angular with out user pressing the ctrl+P. I did found the relevant code in below link and I am able to open the print popup but with just blank white page with no content on it. Thank you for you suggestions in advance.

printListXcel() { this.listService.getListExcel(this.ListId).subscribe(data => { const blobData = new Blob([data], { type:'application/vnd.openxmlformatsofficedocument.spreadsheetml.sheet'}); const blobUrl = URL.createObjectURL(blobData); const iframexcel = document.createElement('iframe'); iframexcel.style.display = 'none'; iframexcel.src = blobUrl; document.body.appendChild(iframexcel); iframexcel.contentWindow.print(); }); } 

how to print pdf in Angular 2

2
  • What browser are you using? Commented Nov 28, 2018 at 18:29
  • I am using chrome. Commented Nov 28, 2018 at 18:31

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.