exportOptions

exportOptions

antoniocibantoniocib Posts: 277Questions: 62Answers: 1

Hi guys,
With exportOptions in button export Excel i can do export of only rows visibile in a page not of all table?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    This thread should help, it's asking the same thing.

    Cheers,

    Colin

  • antoniocibantoniocib Posts: 277Questions: 62Answers: 1

    i used this but dont work

    { extend: 'excelHtml5', exportOptions: { columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] } , modifier: { page: 'current' } },

  • kthorngrenkthorngren Posts: 21,344Questions: 26Answers: 4,954

    export Excel i can do export of only rows visibile in a page not of all table?

    Do you have serverSide: true enabled? If so see this FAQ.

    Kevin

  • antoniocibantoniocib Posts: 277Questions: 62Answers: 1

    No i havent enabled serverSide : true

  • antoniocibantoniocib Posts: 277Questions: 62Answers: 1

    this is my code

    var table = $('#scrivania1').DataTable( {
    //  serverSide: 'true',
        dom: 'Bfrtip',
        ajax: 'php/table.scrivania1.php',
    
  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • kthorngrenkthorngren Posts: 21,344Questions: 26Answers: 4,954
    Answer ✓

    Sorry, misread your question. You want to only export the current page :smile:

    Looks like you need to put the modifier inside the exportOptions option, like this:

                    exportOptions: {
                      columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] ,
                      modifier: {
                        page: 'current'
                      }
                    }
    

    Kevin

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    See my comment too, I gave an example of that...

This discussion has been closed.