Currently, I am exporting an excel file for a client user where the user enters their data based on the corresponding headers in the excel file. Once the user completes entering their data, they upload the excel back to the system. The issue I am facing is that when the headers are downloaded, they appear in a single column separated by commas. My requirement is to have each header in a unique single column as shown in this example: https://i.sstatic.net/sfZht.png
I need the headers to be displayed like this: https://i.sstatic.net/Wljw5.png. Below is my code snippet:
$scope.DownLoadTemplate = function () {
for (a in $scope.SalaryHeadList)
{
$scope.HeadTitle = $scope.SalaryHeadList[a].Title;
$scope.HeaderList.push(angular.copy($scope.HeadTitle));
}
$scope.CurrencyTitle = $scope.CurrencyList[0].Title;
$scope.HeaderList.push(angular.copy($scope.CurrencyTitle));
var url = window.URL.createObjectURL(new Blob([$scope.HeaderList]));
var link = document.createElement('a');
var filename = "Employee.xls";
link.href = url;
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
}
Please help me resolve this issue!