Is there a way to make the output of the "print" button respect rowGroup and hidden columns?
Is there a way to make the output of the "print" button respect rowGroup and hidden columns?

I make a table that has 4 columns at the beginning that are hidden, and the table is grouped by another column that's a concatenation of the 4. But when I print, I get those 4 columns printed out, and no grouping. Possibly because of that, the resulting table is too wide for the page.
Table is defined with
var entryTable = $('#entries-table').DataTable({
destroy: true,
select: true,
rowGroup: {
dataSrc: 'category'
},
orderFixed: [
[0, 'asc'],
[1, 'asc'],
[2, 'asc'],
[3, 'asc']
],
data: data,
columnDefs: [{ visible: false, targets: [0, 1, 2, 3] }],
columns: [
{ data: 'boatcategory' },
{ data: 'boatclass' },
{ data: 'agecategory' },
{ data: 'gendercategory' },
{ data: 'boatnumber' },
{ data: 'p1name' },
{ data: 'p1addr2' },
{ data: 'p2name' },
{ data: 'p2addr2' }
],
searching: false,
lengthChange: false,
buttons: [
'print',
'pdfHtml5',
'csvHtml5'
]
});
It looks like
https://imgur.com/a/Cr82NGA
in the browser, but looks like
https://imgur.com/a/g9wR3Su
when printed.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The RowGroup information is not exported. The limitations section of the RwoGroup docs document this.
Here is an example of using column selectors to choose which columns to export:
https://datatables.net/extensions/buttons/examples/html5/columns.html
Kevin