CSV Export only certain columns
CSV Export only certain columns
jlock
Posts: 14Questions: 4Answers: 0
i have a table with 5 columns and want to keep all 5 columns visible on the page but when the user clicks the CSV export button, i want to determine which columns will be on the excel sheet, namely I don't want the last column to show on the export. Is this possible?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
This example show how to use column selectors when exporting:
https://datatables.net/extensions/buttons/examples/html5/columns.html
Kevin
Thank you so much! That is exactly the page I needed.
i want to export one column , possible or no
The example linked to above shows how. Just put the single column number in the array.
Kevin
How we can export selected columns + content of text box in the page
See if this thread helps with exporting the text box value:
https://datatables.net/forums/discussion/comment/134896/#Comment_134896
Kevin
For example I have 2 columns (Name & Age) + on the top TextBox (some words)
the result:
Name, Age,TextBox
A1,10,some words
A2,30,some words
A3,23,some words
I want to select whatever columns I want and then click the export to Excel button and just my selected columns will export. Possible?
@hermonm ,
The example states that the column selector uses the
column-selector
options. You can use things like class or functions or whatever fits your needs.Kevin