I have the following function that exports an 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 problem is that, i can't put a specific file name to save as so the user gets something like:
Do you want to save %3Ctable%20id%3D%22tableRslts%22%20tabindex%3D%2235%22%20 file?
And the saved file is like:
IytvT8Jo.xls.part.xls
(at least in Firefox which is the target browser we will use)
How would you fix this?
There are two options which you could look into: