Datatables pdf and copy buttons issue on my site.

Datatables pdf and copy buttons issue on my site.

ibrar0ibrar0 Posts: 3Questions: 1Answers: 0

Hello Experts,

I have datatables latest version, with their buttons addon as latest version as well. Having issue with copy and pdf button functionality. Website stuck when try to export in pdf all 630 rows(records). Same goes with copy button. Though it doesn't stuck on it, but data doesn't copy in clipboard.

If i filter records to about 200 rows, everything works fine.

Main important thing is pdf, I must get it functional. Pls help me in this regard, is there anything i am missing, or how shall i fix it.

Note: if i filter records upto 390, though it also stuck but only for 15 sec, and download the pdf. but its too bad impact on visitors.

Thanks

Answers

  • ibrar0ibrar0 Posts: 3Questions: 1Answers: 0

    Someone pls help me here is the site i am talking about:

    www.currentjobsforgraduates.com/bulletin2/bulletin2test.php

    u: becky
    p: becky

  • Tom (DataTables)Tom (DataTables) Posts: 139Questions: 0Answers: 26

    I had a look through and it seems that some of the PDFMake functions are causing the majority of the waiting time, which are out of our control.

    I would suggest trying to reduce the amount of data in each row as that could have an impact or possibly looking into a server-side option for generating PDFs

  • allanallan Posts: 63,075Questions: 1Answers: 10,384 Site admin

    Just to add to what Tom said, we suspect that the long text is taking a considerable amount of time in pdfmake's text reflow / layout with it needing to try and fit the rows and columns with larges amounts of text.

    This is backed up by using the Chrome debugger to take a trace and you'll be able to see that nearly all of the time is in the pdfmake code.

    pdfmake is currently the best open source client-side PDF generator, but it does get slow at times. In such cases, server-side generation is really the way to go (unless anyone knows of a faster way to generate PDFs client-side).

    Regards,
    Allan

  • ibrar0ibrar0 Posts: 3Questions: 1Answers: 0

    Hi Allan,

    Thanks for your great tip, I have somehow able to solve stucking issue of browser using pdfmake.js , but now there is another small issue, layout is good for all other pages i am working with as i am using a2 page with landscape orientation, only http://www.currentjobsforgraduates.com/bulletin4/bulletin4test.php corporate sub-menu having issue in pdf, that due to large url, it goes beyond the table width and merging into next columns data.

    I was wondering any way to apply some special formatting like word-wrap, or visibility none, so extra url don't go to the next column, see screenshot pls: http://screencast.com/t/tztJbL3SjDFq

    Thanks in advance,

  • allanallan Posts: 63,075Questions: 1Answers: 10,384 Site admin

    Hi,

    That's really more of a pdfmake question and I'm afraid I don't have enough familiarity with their API and options to be able to offer any help in that regard.

    On the DataTables side of thing, you could use a formatter to truncate long data - I'm not sure if truncated data is acceptable though.

    Allan

This discussion has been closed.