You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a bug in the export CSV with a table with multiple header rows AND first one as rowspan.
From your demo - 2nd one with rowspan you can reproduce the issue by following config below:
output_headerRows: true,
output_formatContent: function (config, widgetOptions, data) {
console.log(config, widgetOptions, data);
if (insertBOM) {
console.warn('BOM');
BOM = "\uFEFF"; // insert BOM UTF-8 to force Excel encoding UTF-8. Without it, the accented characters are not properly shown in Excel but in Notepad++ it does.
insertBOM = false;
return BOM + "**BEGIN**" + data.content.replace(/&/g, '&')
}
return data.content;
}
The console.log will prompt (note where the "BEGIN text is prompted that represent the BOM i'm inserting):
If I change the thead of your demo (copied on my side) and don't use rowspan at first header row, it's completly fine ! The output_formatContent function will output data in the right order (my BEGIN will be prompted first so BOM will also do).
Note, even if in the doc it says "Note including a BOM in the output_encoding option is no longer required!" I'm not able to do it without the BOM even if I let the default encoding option (UTF8) or put the BOM in the output_encoding as per your suggestion in doc // With BOM : 'data:text/csv;charset=utf8,%EF%BB%BF' this has completly no effect to me.
That's why I'm inserted BOM at first part of data which was working until we decided to include the first header row as well (turned output_headerRows to true)
I'm using version 2.31.3 (latest).
Many thanks in advance for your time and for any help !
The text was updated successfully, but these errors were encountered:
Hello @Mottie,
I have a bug in the export CSV with a table with multiple header rows AND first one as rowspan.
From your demo - 2nd one with rowspan you can reproduce the issue by following config below:
The
console.log
will prompt (note where the "BEGIN text is prompted that represent the BOM i'm inserting):wheras I assume to have (note where the "BEGIN text is prompted):
If I change the
thead
of your demo (copied on my side) and don't use rowspan at first header row, it's completly fine ! The output_formatContent function will output data in the right order (my BEGIN will be prompted first so BOM will also do).Note, even if in the doc it says "Note including a BOM in the output_encoding option is no longer required!" I'm not able to do it without the BOM even if I let the default encoding option (UTF8) or put the BOM in the output_encoding as per your suggestion in doc
// With BOM : 'data:text/csv;charset=utf8,%EF%BB%BF'
this has completly no effect to me.That's why I'm inserted BOM at first part of data which was working until we decided to include the first header row as well (turned output_headerRows to true)
I'm using version 2.31.3 (latest).
Many thanks in advance for your time and for any help !
The text was updated successfully, but these errors were encountered: