Buttons table size limits - anybody else running into these?

Buttons table size limits - anybody else running into these?

ahdahd Posts: 6Questions: 0Answers: 0

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

  • allanallan Posts: 61,449Questions: 1Answers: 10,055 Site admin

    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

  • ahdahd Posts: 6Questions: 0Answers: 0

    ...no.

  • allanallan Posts: 61,449Questions: 1Answers: 10,055 Site admin

    Interesting - thanks for the feedback. I'll try to reproduce the issue locally.

    Allan

  • ahdahd Posts: 6Questions: 0Answers: 0

    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.

  • ahdahd Posts: 6Questions: 0Answers: 0

    ...I have a fix. Where do I send patches to?

  • allanallan Posts: 61,449Questions: 1Answers: 10,055 Site admin

    Github repo please :-).

    Allan

  • ahdahd Posts: 6Questions: 0Answers: 0

    Will do.

  • CeliaCelia Posts: 4Questions: 0Answers: 0
    edited August 2015

    Hello,

    I'm very interested in this fix, since I have big datatables to export and face the same issue.
    Thanks in advance !

    Celia

  • ahdahd Posts: 6Questions: 0Answers: 0

    Pull request #15 in.

  • CeliaCelia Posts: 4Questions: 0Answers: 0
    edited August 2015

    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

  • allanallan Posts: 61,449Questions: 1Answers: 10,055 Site admin

    Buttons 1.0.2 with this fix (albeit a little modified) has just been released :-).

    Allan

  • CeliaCelia Posts: 4Questions: 0Answers: 0

    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 :

    for ( var j=0 ; j<columns ; j++ ) {
        row[j] = strip(cells[ cellCounter ]);
        cellCounter++;
    }
    
    

    I hope I'm clear enough since I'm French and not strong in javascript development !

    Thank you again.

    Celia

  • allanallan Posts: 61,449Questions: 1Answers: 10,055 Site admin

    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

  • CeliaCelia Posts: 4Questions: 0Answers: 0

    No problem, thank you very much !

    Celia

  • lucasmandellilucasmandelli Posts: 2Questions: 0Answers: 0

    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

  • allanallan Posts: 61,449Questions: 1Answers: 10,055 Site admin

    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

  • lucasmandellilucasmandelli Posts: 2Questions: 0Answers: 0

    Yes, the Excel and CSV export happen very fast. I'm seeking for a solution. If I find one, I'll post here.

    Thanks.

This discussion has been closed.