Export csv and xl is exporting only page 1 data. I need all data

Export csv and xl is exporting only page 1 data. I need all data

taslim12taslim12 Posts: 3Questions: 1Answers: 0

This is my button code :: please help
// Download Button
var table = $('#user_data').DataTable();
var buttons = new $.fn.dataTable.Buttons(table, {
buttons: [
// 'excelHtml5',
// 'csvHtml5'
{
extend: 'excelHtml5',
footer: false,
exportOptions: {
columns: [0,1,2,3,4,5,7,8,9,10]
}
},
{
extend: 'csvHtml5',
footer: false,
exportOptions: {
columns: [0,1,2,3,4,5,7,8,9,10]
}
}
]
}).container().appendTo($('#buttons'));
//

Replies

  • kthorngrenkthorngren Posts: 21,301Questions: 26Answers: 4,946

    Are you using server side processing? If so take a look at this FAQ.

    Kevin

  • taslim12taslim12 Posts: 3Questions: 1Answers: 0

    Hello,
    My Table data is coming form server side . but for excport i just using button.Please help

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

    Hi @taslim12 ,

    As the FAQ that Kevin sent shows, if you're using serverSide, then the client only has access to the data on the current page. Therefore, you'll need to use a server script to create the XLS. There's a few other threads in this forum discussing that - it would be worth searching for those.

    Cheers,

    Colin

This discussion has been closed.