Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- loadReport(){
- this.spinner.show();
- //////// /////////////// /////////////////////
- this.api.loadReport(this.filterVM)
- .subscribe(res => {
- console.log(res);
- this.spinner.hide();
- ////// //////////////////////////
- this.saveByteArray("Report.pdf", res);
- ////////// /////////////////////
- }, err => {
- console.log(err);
- this.spinner.hide();
- });
- ///// ///////////// //////////////////////////
- }
- saveByteArray(reportName, byte) {
- var blob = new Blob([byte], {type: "application/pdf"});
- var link = document.createElement('a');
- link.href = window.URL.createObjectURL(blob);
- var fileName = reportName;
- link.download = fileName;
- link.click();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement