How do I change the name of file while exporting data to Excel?
I had the same issue, and since the new format (maybe not supported by every browser) the following worked fine for me. This use directly HTML/Javascript without the PHP server part, because using a submit form is too heavy for big data tables.
to
window.open()
behavior (so, no more e.preventDefault()
) but changing href
to data:blabla
and adding download="filename"
: