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?

Paul TomblinPaul Tomblin Posts: 3Questions: 2Answers: 0

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

Answers

This discussion has been closed.