Click here to Skip to main content
15,067,335 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
I work on angular 7 app that compare excel file uploaded with schema file excel I have

I face issue I can't display Excel Not Identical when press button upload and excel Not identical

so if excel file not identical or not same file schema I have
then
when press button upload display message Excel Not Identical that display on console log on ts
so How to do that please

What I have tried:

TypeScript
on component ts
public uploadFile = (files) => {
   
 this._dataService.CompareExcel(this.selectedoptions.toString(),this.fileToUpload)
 .subscribe(resp => {
  if (resp) {
    console.log('Excel is Identical');
   if(this.selectedoptions==1)
 {
 this._dataService.PostUpload(this.selectedoptions.toString(),this.fileToUpload)
 .subscribe((response: Blob) => saveAs(response, this.fileToUpload.name + '.xlsx'));

 }
 if(this.selectedoptions==2)
 {
    this._dataService.PostUploadzip(this.selectedoptions.toString(),this.fileToUpload)
    .subscribe((response: Blob) => saveAs(response, this.fileToUpload.name  + '.zip'));

 }
    
  } else {
    console.log('Excel Not Identical');
    
  }
});
on component.html 

<button (click)="uploadFile(files)" class="btn btn-link" style="margin-right: 0px">
          
            <nb-icon icon="cloud-upload-outline"></nb-icon>
          
        </button>
Posted
Updated 19-Jun-21 12:56pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900