Showing all entries produce error

Showing all entries produce error

dg_datatablesdg_datatables Posts: 53Questions: 10Answers: 1

Hi there,
i have a table with over 8.000 entries (until now, data will rise in future). In some cases i have to export all of them to Excel, therefor i set the lengthMenu to:

"lengthMenu": [[10, 25, 50, 250, -1], [10, 25, 50, 250, "All"]],

It works fine until i use the "All" statement. With "All" i get the following error:

Unable to get property 'length' of undefined or null reference

Can anybody help me? Normally it makes no sense to show all 8.000 entries on the webpage, but i have to export them all to Excel. Perhaps someone knows a better way.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,770
    edited July 2018

    Unable to get property 'length' of undefined or null reference

    I would start by looking at the returned data. The steps in this technote will get you started.

    A better option may be to look for a server side script to generate the Excel files.

    Kevin

  • dg_datatablesdg_datatables Posts: 53Questions: 10Answers: 1

    I'm sorry but there are no returned datas. I checked the Ajax and the Ajax finished normally. It seems that there too many datas, so that datatable will run out of time or out of memory.
    I think the best solution will be, that i do not use the datatable function to export to Excel. I will do the export outside of datatables.

  • allanallan Posts: 61,726Questions: 1Answers: 10,110 Site admin
    Answer ✓

    Sounds like you might need to increase the memory available to the server if you want it to output all 8000 records at once. Or perhaps change whatever code you are using to get the data one row at a time and output it that way.

    Allan

This discussion has been closed.