My current challenge involves a function used to export HTML to Excel:
function generateexcel(tableid) {
var table= document.getElementById(tableid);
var html = table.outerHTML;
window.open('data:application/vnd.ms-excel,' + encodeURIComponent(html));
}
The issue at hand is the inability to specify a file name for saving, resulting in users seeing something like this:
Do you want to save %3Ctable%20id%3D%22tableRslts%22%20tabindex%3D%2235%22%20 file?
And the saved file turns out as:
IytvT8Jo.xls.part.xls
(primarily experienced on Firefox, our selected browser)
How should this be rectified?