datatable library showing poor performance while creating pdf

datatable library showing poor performance while creating pdf

SudiptaSudipta Posts: 23Questions: 0Answers: 0

Hello,
I am using datatable library for generating pdf reports of some tables which contains about 7000-8000 row. The previous version of datatable using flash can generate the report within second , but currently it is taking almost 15 minutes, which is not acceptable in my case. Otherwise a great library. Can someone shed some light ?? Thanks

Replies

  • allanallan Posts: 61,903Questions: 1Answers: 10,148 Site admin

    I presume you are using the third party pdfmake library for the PDF generation? DataTables itself does not create PDFs, but rather uses third party sources to do so. My examples use pdfmake, but I have noticed in the past that it gets exceptionally slow for larger tables.

    Unfortunately there aren't many alternatives at the moment (suggestions welcome).

    What I recommend for large tables is that you create the PDF server-side and download it to the client.

    Allan

  • SudiptaSudipta Posts: 23Questions: 0Answers: 0

    Ok, I have changed the code use the flash pdf component. But in this case, no download progress/notification is displayed, as is displayed by normal file download.

  • allanallan Posts: 61,903Questions: 1Answers: 10,148 Site admin

    That sounds like good old Flash to me :-). Its API doesn't provide options for that - it just creates the file and is downloads it.

    Allan

  • SudiptaSudipta Posts: 23Questions: 0Answers: 0

    Thanks for reply, can jspdf library from Mozilla or chrome be used for pdf generation?

  • allanallan Posts: 61,903Questions: 1Answers: 10,148 Site admin

    There are two reasons I didn't use jspdf:

    1. It doesn't have direct support for tables in its API - you need to use a plug-in or use the very limited html importer.
    2. Its API is not easy to work with.

    Having said that, it is possible I might have to circle back to it as the options are limited in this area. The other option would be to provide a web service to create the html tables, but I'd rather avoid that if possible.

    Allan

This discussion has been closed.