No line breaks while exporting to excel/csv.

No line breaks while exporting to excel/csv.

feroz533feroz533 Posts: 2Questions: 0Answers: 0

Hi,

I'm using render columns option in the columns to show the data with Line breaks in one of the columns in the grid.
But when i use the Export to Excel button functionality, all data is being populated in one line on the cell in the excel sheet even thought orthogonal in export options is default as display.

Replies

  • kthorngrenkthorngren Posts: 21,571Questions: 26Answers: 4,996

    Maybe this thread and the thread it references may help.
    https://datatables.net/forums/discussion/comment/107044/#Comment_107044

    Kevin

  • viswaviswa Posts: 1Questions: 0Answers: 0
    edited March 2017

    Tried the style attribute as 55. But still all the table cell content was displayed in single line. Line breaks were not retained.

    Ex:
    Datatable displays the data in cell as:
    New Line1
    New Line2
    New Line3

    Exported Excel cell shows it as:
    New Line1 NewLine2 NewLine3

  • allanallan Posts: 63,871Questions: 1Answers: 10,525 Site admin

    Did you also set the stripNewlines option (see buttons.exportData()) to be false? You can set those options through the exportOptions parameter of the button (excelHtml5 in this case).

    Allan

This discussion has been closed.