Buttons table size limits - anybody else running into these?
Buttons table size limits - anybody else running into these?
I just upgraded from TableTools to Buttons 1.0.
Tables of 8000 rows which TableTools handles fine, break the Buttons "export-to-CSV" button. Break as in: I click the button, script times out and I get the "This script has stopped or is nonresponsive. Stop or debug it?" dialog from my browser. (this is on OS X, reproduces on Chrome or Firefox equally certainly).
Table is 6 columns, none of which have over 60 characters of text in the cell, 8000+ rows. Table rows are populated by DataTables via AJAX, which is always pulling valid JSON and rendering all the rows properly, irrespective of size.
Smaller tables work, bigger tables fail. Crossover point seems to be between 500 and 1000 rows. As you get nearer the crossover point the export attempt takes longer and longer.
Excel export button fails similarly, but I'm debugging with the CSV button only to minimise complications.
I have traced the failure point to inside the _exportData function in dataTables.buttons.js; the "var body = dt.rows(...).map(...).toArray()". For a large enough table, execution just goes in there and doesn't come out again.
Is anybody else seeing these kind of limits on how big a table you can export with Buttons? Anybody got a workaround?
Replies
Unfortunately I think this is a bit of a limitation with the data:// export method that is used to create the files in HTML5. If you use the Flash buttons for Buttons, does it function like TableTools used to?
Allan
...no.
Interesting - thanks for the feedback. I'll try to reproduce the issue locally.
Allan
I have been using Firefox and Chrome on OS X to view.
The symptoms are the same on Firefox on Windows 7.
I have upgraded to Buttons 1.0.1.
...I have a fix. Where do I send patches to?
Github repo please :-).
Allan
Will do.
Hello,
I'm very interested in this fix, since I have big datatables to export and face the same issue.
Thanks in advance !
Celia
Pull request #15 in.
Hello,
I was waiting for the fix in pull request #15 by ahd, which makes it really fast to export big datatables. Thank you, this is a great improvement !
Celia
Buttons 1.0.2 with this fix (albeit a little modified) has just been released :-).
Allan
Hello,
Thank you so much for this improvement !
However, I have a question : is it normal that the strip() method which is called on header and footer isn't called anymore on the row content ?
I had to add it for myself to have the same content as before :
dataTables.buttons.js line 1424 :
I hope I'm clear enough since I'm French and not strong in javascript development !
Thank you again.
Celia
No - that is a complete mistake :-(. I've just tagged Buttons 1.0.3 which addresses this and am packaging it up at the moment. Sorry for the trouble.
Allan
No problem, thank you very much !
Celia
Hello,
I'm having the same error ahd had before. I'm using cdn and can't export pdf with 786 entries.
Here is an exemple: http://live.datatables.net/tanokizu/1
It looks like some kind of performance limit in the pdfmake library. The Excel and CSV export happen almost immediately, while the PDF is spending a lot of time in pdfmake building the PDF. This I'm afraid looks like a limitation in the thirdparty library.
Allan
Yes, the Excel and CSV export happen very fast. I'm seeking for a solution. If I find one, I'll post here.
Thanks.