How to make it so that a CSV export includes ONLY data and not header row

How to make it so that a CSV export includes ONLY data and not header row

webpointzwebpointz Posts: 126Questions: 30Answers: 4

I have the following code that exports data perfectly except it includes a header row and I need only data.

How can I turn off the header row?

{ extend: 'csv', text: 'Export CSV for Upload', filename: 'file_for_upload', 
                exportOptions: {
                    columns: [ 4,5,6,7,8,9,3,2,12,13,14 ]
            }}

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,322Questions: 26Answers: 4,948
    Answer ✓

    Try using header: false. Similar to this example of who to include the footer.

    Kevin

  • webpointzwebpointz Posts: 126Questions: 30Answers: 4

    Perfect, thanks. Had the header: false in the wrong place.

  • webpointzwebpointz Posts: 126Questions: 30Answers: 4
    edited November 2020

    Code is now:

    { extend: 'csv', header: false, text: 'Export for Upload', filename: 'file_for_upload, 
                    exportOptions: {
                        columns: [ 4,5,6,7,8,9,3,2,12,13,14 ]
                }}
    
This discussion has been closed.