Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tableExport.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ THE SOFTWARE.*/
window.open('data:application/json;filename=exportData;' + base64data);
}else if(defaults.type == 'xml'){

var xml = '<?xml version="1.0" encoding="utf-8"?>';
var xml = '<?xml version="1.0" encoding="iso-8859-1"?>'; //Accept accents (Example: João)
xml += '<tabledata><fields>';

// Header
Expand Down Expand Up @@ -276,7 +276,11 @@ THE SOFTWARE.*/
excelFile += "</html>";

var base64data = "base64," + $.base64.encode(excelFile);
window.open('data:application/vnd.ms-'+defaults.type+';filename=exportData.doc;' + base64data);
var anchor = document.createElement('a');//Create an anchor element
document.body.appendChild(anchor); //Add it to document
anchor.href = 'data:application/vnd.ms' + (defaults.type === 'doc' ? 'word' : '-' + defaults.type) + ';filename=exportData.doc;' + base64data; //Create content and mime type
anchor.download = 'exportData.' + (defaults.type === 'excel' ? 'xls' : (defaults.type === 'powerpoint' ? 'ppt' : defaults.type)); //Custom filename+ext (ext fix)
anchor.click();//Launch

}else if(defaults.type == 'png'){
html2canvas($(el), {
Expand Down