kenken
June 17, 2015, 4:30pm
21
In my download button events I have something like:
var link = window.document.createElement("a");
link.setAttribute("href", "data:text/csv;charset=utf-8,%EF%BB%BF" + encodeURI(csv));
link.setAttribute("download", "export_invoices_" + fileName + ".csv");
link.click();
the variable csv
is comma separate string.
2 Likes
rafael
June 18, 2015, 11:20pm
22
I figured out how to achieve this with Papa Parse. Worked so great that I decided to write a tutorial about it . Comes with a repo and an online demo if you want see how it will look. Hope it can help anyone.
4 Likes
Parfait.
Nice work.
Nicely explanation
I found the easiest fix via BOM; just add the magic at beginning of the string, when creating the buffer for the file export:
let buffer = Buffer('\ufeff'+csvString)
Thanks, KENKEN ⦠Great.
I can see correct CSV content with format font on Excell
1 Like
zehra
January 21, 2022, 6:39am
26
Did you find a solution? Iām also having trouble with the excel format.