Posts

Showing posts from July, 2022

excel download in angular

  download (){     if ( this . fromdate2 == undefined ){       this . filename = "AllIssues" ;     } else {       this . filename = this . fromdate2 ;     }             this . downloadFile ( this . jsonData , this . filename );   }     downloadFile ( data , filename = 'data' ) {     let date ;     if ( this . fromdate2 == undefined ){     date = '' ;     } else {       date = 'Month: ' + this . fromdate2 ;     }     let csvData = this . ConvertToCSV ( data , [ 'ArmyNo' , 'Name' , 'Rank' , 'Unit' , 'Issue' , 'ReportedOn' , 'ResolvedOn' ]);     console . log ( csvData );       let blob ;     if ( date == '' ){         blob = new Blob ([ ' \ufeff ' + csvData ], { type : 'text/csv;charset=utf-8;' });         } else {   ...