Generacion de Archivos con Nombre (Matriz o Foro )
git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C222
This commit is contained in:
parent
c4f1e98491
commit
52f39eb548
1 changed files with 38 additions and 1 deletions
|
|
@ -1782,4 +1782,41 @@ this.ValidarAcceder = function (vista, controlador,opcion) {
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('No tiene permisos para ejecutar esta opción', Message_Warning);
|
toastr.warning('No tiene permisos para ejecutar esta opción', Message_Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.ExportarAMsWord = function (html, filename) {
|
||||||
|
|
||||||
|
var blob = new Blob(['\ufeff', html], {
|
||||||
|
type: 'application/msword'
|
||||||
|
});
|
||||||
|
|
||||||
|
// Specify link url
|
||||||
|
//var url = 'data:application/vnd.ms-word;charset=utf-8,' + encodeURIComponent(html);
|
||||||
|
var url = 'data:application/vnd.ms-word;charset=utf-8,' + encodeURIComponent(html);
|
||||||
|
|
||||||
|
// Specify file name
|
||||||
|
filename = filename ? filename + '.doc' : 'document.doc';
|
||||||
|
|
||||||
|
// Create download link element
|
||||||
|
var downloadLink = document.createElement("a");
|
||||||
|
|
||||||
|
document.body.appendChild(downloadLink);
|
||||||
|
|
||||||
|
if (navigator.msSaveOrOpenBlob) {
|
||||||
|
navigator.msSaveOrOpenBlob(blob, filename);
|
||||||
|
} else {
|
||||||
|
// Create a link to the file
|
||||||
|
downloadLink.href = url;
|
||||||
|
|
||||||
|
// Setting the file name
|
||||||
|
downloadLink.download = filename;
|
||||||
|
|
||||||
|
//triggering the function
|
||||||
|
downloadLink.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
document.body.removeChild(downloadLink);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue