[Datatables Buttons] Preserving Line Breaks when Exporting to Excel

[Datatables Buttons] Preserving Line Breaks when Exporting to Excel

jon93jon93 Posts: 4Questions: 1Answers: 0

Hello,

I have a datatable with occasional <br style="mso-data-placement:same-cell;"/> tags. The export to Excel (.xlsx) doesn't sustain that html code and as such all those pieces of text are just stuck together. Everything else regarding the export works fine.

I tried looking into multiple functions - exportData() with stripNewlines = false, columnDefs with a render function with data manipulation inside, and fnCellRender, which was supported in Tabletools but does not seem to be supported in Buttons anymore. I did a fairly thorough search of the Datatables forum and found a couple of similar posts but no clear answer.

Do you know if there is a way to keep line breaks in the Excel Export?

Thank you,
Jonathan

Replies

  • allanallan Posts: 64,046Questions: 1Answers: 10,557 Site admin

    If you are willing to use a currently unreleased version of Buttons, then this example (itself as yet unpublished) shows how you are use a custom renderer.

    The software with this feature and example will be released, probably next week now.

    Allan

  • jon93jon93 Posts: 4Questions: 1Answers: 0

    Thank you Allan. I will probably test the unreleased version of Buttons at one point, but most likely will wait for the future release to incorporate it in my website. Would the new release be Buttons 1.0.2? And would it be posted in the Announcements?

  • allanallan Posts: 64,046Questions: 1Answers: 10,557 Site admin
    edited October 2015

    The next release will be 1.1.0. The current release is 1.0.3.

    Yes, I will post a message in the announcements category in this forum and in the releases RSS feed.

    Allan

This discussion has been closed.