Buttons Print Chrome problem
Buttons Print Chrome problem
jvcunha
Posts: 81Questions: 10Answers: 1
Hi,
in Chrome (Version 61.0.3163.100 (Official Version) 64 bit), it opens new tab but does not display the print preview, even setting autoPrint: true
Firefox, Safari, Edge and IE are ok apparently.
In this example the same problem occurs when you click Print, open the tab, and display the print preview. After closing the preview and clicking Print again, open the tab but not the preview .: https://datatables.net/extensions/buttons/examples/initialisation/export
This discussion has been closed.
Replies
Thanks for posting this. There are a couple of other threads on this topic as well, including this one.
It looks like an error that was introduced in Chrome 61.
Allan
Hi Allan,
Thanks for the quick response. Actually the solution you suggested worked. I commented on setTimeOut and it worked perfectly again.
Once again, congratulations on the excellent component!
It sure makes life easier for many developers.
By marking as answered please!
Regards,
Jone
I was warned now that it works but ... lost all css
sorry
curiosity:
- if you leave Settimeout it opens the new tab but does not open the print preview;
- if you click on any other chrome tab and then go back to this where the report is mounted, the preview appears ... ie changing the tab and returning it appears!
hope this can help in a solution
Hi Allan,
I changed the code of buttons.print.js not to open another tab but to inject a frame into the current page. After that it opens the direct preview on the page without pruning of the new tab, this way the chrome problem does not occur and maintains the css.
I hope you can help other users, work for me.
Here is updated code:
Thanks for suggesting that - looks like an interesting way of resolving it. When I get a chance I'm going to try injecting code into the created document in Buttons and see if that helps to resolve it.
Allan
jvcunha, thank you for posting your solution.
I ran into this problem today working on some code; I would click the Print button, the new tab would appear but not the print dialog. Curiously if I go back to the first tab then switched back to the print tab that was created then it would continue as normal.
I tried your code above and so far it seems to be working as expected.
thanks jvcunha ! it works fine for me also.
Has there been any progress on resolving this problem? jvcunha's fix works for me in Chrome, but I don't get any preview/output in Firefox. (57.0.3 64 bit) (thats using the latest Buttons extension download (1.5.1))
Just wanted to check before trying to munge up a fix that takes into account whether it's on Firefox or not...
Thanks!
Sorry no - I've not had a chance to fig into this issue yet.
Allan
Hi Jeffrey,
just change a portion of the code that I made available, testing the browser:
hi,
sorry for my bad English.
I was dealing with this issue and I managed to solve it with:
regards
Its resolved here and will be in the next release of Buttons.
Allan
@allan, i downloaded the fixed version of buttons.print.js file but looks like it only works for Chorme/Opera but when you customize print button, it doesn't work in IE. Any idea??
Happy to take a look at a test case showing the issue.
Allan
Hi jvcunha,
I have used your code as I was facing same issue. the issue got resolved but now it is automatically invoking Printer Setup
Use the
autoPrint
option of theprint
button to disable that.Allan
@allan any update on customise print not working on internet explorer
Can you give me a link to a page that shows the issue? This thread is about a Chrome issue.
Allan
Customise print is not working on internet explorer for me too...when chrome fix is applied.
Happy to take a look at a test case showing the issue.
Allan
I've just tried the nightly version in both Edge and IE. It appears to work as expected for me. As I say, if it isn't for you, please link to a test case showing the issue.
Allan
https://datatables.net/extensions/buttons/examples/print/customisation.html
The print button in the above example doesn't open the print dialog in IE. It just opens the print preview.
Yup - its doing that for me in IE11 as well - thanks for pointing that out. I'll check it out.
Allan
Any Update please?
Can anyone please post a solution for print dailog not opening in IE?
Sorry - I've not had a chance to dig into this yet. I'll post back when I have.
Allan
I've just tried IE11 with the nightly version of Buttons and it opens the print dialogue box automatically no problem.
Allan