Download a CSV?
I am trying to create a list of parts by tapping on a model and then download that list as a CSV. It works great on preview mode but does not work in Vuforia View.
I have tried:
$scope.CreateCSV=function(){
var rows= $scope.PartTableList;
var csvContent =[];// "data:text/csv;charset=utf-8;";
// Add headers
const headers = Object.keys(rows[0]).join(",");
csvContent += headers + "\r\n";
// Add data rows
rows.forEach(item => {
const values = Object.values(item).join(",");
csvContent += values + "\r\n";
});
var encodedUri = encodeURI(csvContent);
window.location.assign(encodedUri);
}
and that works in preview but not in Vuforia View.
I have also tried another method:
$scope.CreateCSV=function(){
var rows= $scope.PartTableList;
var csvContent =[];// "data:text/csv;charset=utf-8;";
// Add headers
const headers = Object.keys(rows[0]).join(",");
csvContent += headers + "\r\n";
// Add data rows
rows.forEach(item => {
const values = Object.values(item).join(",");
csvContent += values + "\r\n";
});
$scope.downloadcsv=function(content, filename, contentType) {
// Create a blob
var blob = new Blob([content], { type: contentType });
var url = URL.createObjectURL(blob);
// Create a link to download it
var pom = document.createElement('a');
pom.href = url;
pom.setAttribute('download', filename);
pom.click();
document.body.removeChild(pom)
}
With the same results.
Is there any way to do this?

