Excel export of huge number of rows
Excel export of huge number of rows
Hi everybody,
I have to export a table containing almost 25 thousands rows to excel. I've initialized the Excel button with these parameters:
dom: 'Bfrtip',
buttons: [ {
extend: 'excelHtml5',
exportOptions: {
columns: [ 1, 2, ':visible' ]
},
className: 'bt-default',
filename: 'myfilename',
title: 'mytitle'
} ]
When I select it, I got "Page not responding" error from my browser and the file is not downloaded. How do you suggest I proceed with that?
If I create multiple sheets in the customize section, each of them with 4 thousands rows approximately, would fix that? Is it possible to do something like that?
Or is it a technology limitation, which I simply can't export a table like that?
Thank you,
Guilherme
Answers
Hi @guilhermemaranhao ,
I suspect you're reaching the end of the technology as you suggested. I don't think splitting it into sheets would help, since the time would still be the same which would kill the browser.
You could split it into chunks using the exportOptions row-selector - see here (it's only exporting first 25 rows).
Hopefully that could do the trick,
Cheers,
Colin
Thank you, @colin ! I'll take a look at it.
Hi @colin ,
In my application, there is a filter of states, that the user can filter the data.
I was thinking on forcing the user to choose a state before exporting the table (if there is no state chosen).
The problem with my solution is that I would be overwriting the 'action' method. Is there another way i could alert the user? Or with I make a custom button, how can I invoke the excel exporting functionality?
Or at least, can I define a tooltip in my button?
I've found it.
property.
But if I could do it with the action method, like I suggested before, would be much better.
Hi @guilhermemaranhao ,
Yep, you can call the standard action in the button you extend, for example here.
Cheers,
Colin
Great, @colin !!
That's what I need!
Thank you very much!
Guilherme