Unable to download using html5 bottons
Unable to download using html5 bottons
raja_bow
Posts: 4Questions: 1Answers: 0
Hi, I am using html5 buttons to download table data. Table contains around 4900 rows. It works for rows until 4670 but if it’s more than that and when I click the button it’s showing loading icon in the button and nothing happened after that. This issue is happening only in chrome browser. Any restriction on the rows in chrome? Thanks for the help.
This discussion has been closed.
Answers
Hi @raja_bow ,
We're happy to take a look. As per the forum rules, if you could link to a running test case showing the issue we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Hi Colin,
When I tried to create a sample program for your reference I observed this error on the browser console "Uncaught TypeError: b.buttons.exportInfo is not a function". I also found the root cause of the issue from this link "https://datatables.net/forums/discussion/46441/error-button-print" and fixed the issue in the sample. So to test the same use case, I used the sample Javascript links in my project and tried the download and it worked fine.
I checked again on the application with the old Javascript and in the browser console I can see a script error as shown in the attached link. Not sure what's the issue but I used the latest Javascript to settle the download issue. If you have any clue on this error please help to share. May be useful in future
(https://datatables.net/forums/uploads/editor/ig/pmfpsoksgez8.png "")
Thank you very much for helping me to find a solution and settle this issue.
Regards
Raja
Hi @raja_bow ,
Something is looping in your code I suspect, but without seeing it, it's impossible to predict.
Cheers,
Colin
Hi Colin,
Thank you very much for your time and support on this issue.
I am facing another issue where the download take more than 90 seconds. I tried to upload the scripts into jsfiddle but the browser is hanging due to the no of rows. Do you have any idea why the download takes long time? I have attached the file with this post, since the size is big i zipped it.
Thank you very much for your support.
Regards
Raja
Hi @raja_bow ,
It'll just be the size of the data - you've got 5k rows with 30 columns each. If you consider just loading the source for that page took my browser over 30 seconds, doing anything inside a script within that page is going to be time consuming too.
Cheers,
Colin
Hi Colin,
So you mean the time taken is just because of the data volume and not because of the script itself is it?
Regards
Raja
Hi @raja_bow ,
Yep, your script isn't doing anything complex - you just have a very wide and very long table, which is just pushing the browser. I tried it on both Chrome and Firefox, and I'd say they're both behaving the same.
It would be worth considering if you could hide some columns, or maybe amalgamate a few to reduce the count and see if that makes a difference. Using the column visibility buttons could be a good way to go, to allow the user to choose a type of report/export perhaps.
Cheers,
Colin