8
Guys I use the very simple routine below to export to excel, it works cool, but I would like to give a name to the file when exporting, but I didn’t want to use plugins or huge functions just add a name to the file if possible
function ExportToExcel() {
var htmltable = document.getElementById('exportdata');
var html = htmltable.outerHTML;
window.open('data:application/vnd.ms-excel, ' + encodeURIComponent(html));
}
Currently the browser bears the name Download(1). xls, Download(2). xls etc I would like to set a name of my own, I saw some examples here in Stack but I would have to change my codes
Simple and objective, very good
– Marcelo
When exporting it is messing up the accented characters, the so-called Ncode, is that it has a.charset = "UTF-8" or something that can bring the characters without messing up?
– Marcelo
This code does not create columns in Excel. When opening the ". xls" of this example, all columns are joined in the first column, as a single string.
– Rodrigo De Almeida Siqueira