Print Only Visible Columns
-
I need help! I’ve been searching the forum for hours and experimenting with commands that were related. I can answer yes to all your questions in Important: Please read this, before asking for support with TablePress! The pluging works fine. The CSS I found works fine. I just need to be able to do one thing – print only the visible columns.
I activated DataTable Buttons. [table id=3 datatables_buttons=”colvis,copy,csv,excel,pdf,print” /]
I have seven columns. Two are hidden using CSS. I used the CSS so the columns could be searched without being visible. I spent hours on the forum searching for a code that I could add to the ‘Custom Commands’ section. I found several, but none of them worked. I tried modifying the code, but I could not get any of the modifications to work.Here’s some attempts.
Placed in ‘Custom Commands’ section. This did not work. I removed it.
“buttons”: [
{
“extend”: “copyHtml5”,
“exportOptions”: {
“columns”: [ 0, “:visible” ]
}
},
{
“extend”: “excelHtml5”,
“exportOptions”: {
“columns”: “:visible”
}
},
{
“extend”: “pdfHtml5”,
“exportOptions”: {
“columns”: [ 1, 4, 5, 6, 7 ]
}
},
“colvis”
]Placed in ‘Custom Commands’ section. This did not work either. It eliminated all the buttons except for PDF, and that did’t work. I read that @sagirish had figured out where he went wrong with this code, but there was no further comment about it that I could find.
“buttons”: [
{
“extend”: “pdfHtml5”,
“exportOptions”: {
“columns”: [ 1,4,5,6,7 ]
}
}
]I tried this [table id=3 datatables_buttons=”pdf,print” datatables_buttons_exclude_columns=2,3 /] along with some variations
None of them worked.
Is there a simple solution to print only the visible columns?
Thank you very much for your assistance. This is a great plugin. If I can get it to work as needed, I will be making a donation.
Jason
The page I need help with: [log in to see the link]
- The topic ‘Print Only Visible Columns’ is closed to new replies.