excel, PDF, csv button exporting also disabled/hidden fields

excel, PDF, csv button exporting also disabled/hidden fields

javismilesjavismiles Posts: 205Questions: 38Answers: 3

Im testing the excel, pdf, csv export buttons
buttons: [
'excelHtml5',
'csvHtml5',
'pdfHtml5'

all working well, except something super important,
some of the cells in the table I have disabled and hidden because they are only used to calculate things for other cells,
and yet they are being exported in the excel, pdf, etc, this is real inconvenient for me,
how can I make sure that excel, pdf etc only export visible cells? thank u

This question has an accepted answers - jump to answer

Answers

  • javismilesjavismiles Posts: 205Questions: 38Answers: 3

    got it, its this way, we can close this now:

    {
            extend: 'pdfHtml5',
            text: 'Save PDF',
            exportOptions: {
                columns:[1,2,3,4,5,6,8],
                modifier: {
                    page: 'current'
                }
            }
            },
            {
            extend: 'excelHtml5',
            text: 'Save Excel',
            exportOptions: {
                columns:[1,2,3,4,5,6,8],
                modifier: {
                    page: 'current'
                }
            }
            }
    
  • javismilesjavismiles Posts: 205Questions: 38Answers: 3

    but one thing, when I have two of these side to side, there is no padding between them and they have the same background color and it all feels like 1 button, how can you add some margin/padding between the buttons? thank u

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin

    Yes, the columns option of the exportOptions object is the way to select which columns to export.

    What styling framework are you using for your buttons? A screenshot would be useful, or even better a test case :).

    Allan

  • javismilesjavismiles Posts: 205Questions: 38Answers: 3

    using bootstrap 4 as provided by your downloader :) Im sorry would love to provide a test case but this is embedded within a large web app in prototyping stage and its very difficult to provide a link to it at the moment, thank u again Allan ;)

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Answer ✓

    It appears to work as expected in this example. Can you modify it to show the issue?

    here is no padding between them and they have the same background color and it all feels like 1 button

    That's how Bootstrap 4 styles its button groups. Perhaps add a border to the buttons or a little margin if you want to.

    Allan

  • javismilesjavismiles Posts: 205Questions: 38Answers: 3

    yes thank u Allan, these are all solved now, thank u, we can close this

This discussion has been closed.