Datatables - Export to Excel

Datatables - Export to Excel

walkermdwalkermd Posts: 1Questions: 1Answers: 0

Hi
We're using Datatables in an application and have just started adding in the export to Excel function (using Buttons). It works great but have a question. In our tables we're using some hidden spans for sorting purposes (mostly dates). These hidden spans are also included in the export to Excel. Is there any way to not have these exported to Excel?
Thanks
Mark

Answers

  • ztevieztevie Posts: 101Questions: 23Answers: 5
    edited January 2017

    buttons: [
    {
    extend: 'excel'',
    exportOptions: {
    columns: '1, 3, 4'
    }
    }
    You replace 1 3 4 with whatever columns you want to export. I think you can also exclude certain columns, but don't remember exactly how.

  • allanallan Posts: 63,839Questions: 1Answers: 10,518 Site admin

    Another option is to use orthogonal data or an output formatter.

    Allan

This discussion has been closed.