-
Notifications
You must be signed in to change notification settings - Fork 718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple lines #124
Comments
Hey @hhurz , I am trying to accomplish this multiple lines cells export representation.. But it seems my HTML: <td>
AAA<br>
BBB<br>
CCC
</td> This is exported into CSV as "AAABBBCCC".... CSV Export settings: elm.tableExport({
type: 'csv',
escape: false,
ignoreColumn: colIgnore,
maxNestedTables: 2,
preserve : {
leadingWS: true,
trailingWS: true
},
csvUseBOM: (d?d.csvUseBOM:false),
fileName: (s?s:'TableExport') + formattedDate()
}); I would either try to accomplish this: Or write a function to convert Thanks again, Michal |
Hi, thanks for reporting this issue. It's a regression bug and will be fixed in next release. Normal behavior should be that new lines will be turned into spaces and |
How would new lines work for csv? Or for json/xml? |
Working fine. For my understanding new lines do not violate the specs of those formats. When opening such a csv file in Excel you get the result as you would acomplish it (see above). The json result was accepted by online validators and could successfully open it in my json viewer. Same for xml. |
Thx again, waiting for the update :) |
Updated to 1.9.15 and bug still present.. Both scenarios (new lines or |
Working for me 🤔 Here you see the result when exporting table "issue124" from the testfile as csv: |
Ok, got it: The detection of br tags containing attributes doesn't work. That needs to be fixed... |
Hey, tested and wokrs! However I came to point out configuration where I have I would like to clarify here what is the recommended way to split content into multiple lines within cell not using angular and your library will respect it? Other question here what about the proposed attribute for separator in case of new lines? So by default it would be |
I think you could solve this by using one of the provided callback functions onCellHtmlData or onCellData. Both are called during parsing of every cell. onCellHtmlData is called at the beginning and onCellData at the end of the parse process. Look in the clossed issues (e.g #44) for onCellHtmlData to get more information. Regarding the proposed attribute: I put this on to my feature request list... |
Hi! I'm trying to display multiple lines with an xlsx format. Any suggestions? |
@jwiel86 What have you tried until now? |
In my case |
In function parseString there is:
`var text = htmlData.replace(/\n/g,'\u2028').replace(/<br\s*[/]?>/gi, '\u2060');
var obj = $('
text = '';
Isn't that error? There shouldn't be: text += "\n" ? Because for now you can't export text with multiple lines (separated by character: \n) for example to csv. Current code replace \n with \u2028, split text by this and join with space instead of new line character
The text was updated successfully, but these errors were encountered: