Can "File Export" buttons be made to exclude hidden columns?
Can "File Export" buttons be made to exclude hidden columns?
abh555
Posts: 6Questions: 2Answers: 0
I was able to make the sample work in my program very easily, but my table contains hidden columns I want to exclude from the export. Is there any simple way to exclude the hidden columns from the export?
https://datatables.net/extensions/buttons/examples/initialisation/export.html
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
See if this column selector example helps:
https://datatables.net/extensions/buttons/examples/html5/columns.html
Kevin
Thanks Kevin, that was very helpful. I was able to get the desired result, but had to list the column numbers. I couldn't get "columns: ':visible'" to work -- I assume the intent is for it to include only visible columns?
No - it should be quite possible to include hidden, visible and anything inbetween. The example Kevin linked to shows the Excel button being used to export visible columns only. Change the column visibility using the Column visibility button and then click export to see that effect.
Allan
I must have had something else wrong when I tried this last night, it's working fine this morning. Thanks very much for your help!