Export to CSV ignores <> characters.

Export to CSV ignores <> characters.

maruthikumar80maruthikumar80 Posts: 5Questions: 2Answers: 0
edited May 2018 in Free community support

Hello All,

When I export data from Datatable to csv format, it ignores < > characters.
For instance if the cell value is <>Maruthi, after exporting to csv it prints only Maruthi
Can anyone help me how to resolve this?

Regards,
Maruthi Kumar

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @maruthikumar80 ,

    I just tried it here, and it's working fine for me. Could you modify that example please so that it demonstrates your problem,

    Cheers,

    Colin

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    Disable the stripping of HTML using the stripHtml option of the export button options (csvHtml5). The regex used for the stripping of HTML is overly simple and will just remove <> and anything between them.

    Allan

  • maruthikumar80maruthikumar80 Posts: 5Questions: 2Answers: 0

    Thank you, Allan. Now it is working. As you suggested I changed the option.
    extend: 'csvHtml5',
    exportOptions: {
    columns: ':visible',
    stripHtml : false
    }

    Regards,
    Maruthi Kumar

This discussion has been closed.