Formatting Print export - headers appear mid-page or data columns get cut
Formatting Print export - headers appear mid-page or data columns get cut
I'm having challenges formatting my Print output. When exporting as Landscape or Portrait the row header repeats mid-page. When I change to Portrait or Landscape respectively, (eg from #1 to #2, or #3 to #4 the data columns then get cut off. This happens (data cols get cut off) even if I try refreshing the browser, and printing to the new (2 or 4) formats.
Could you help me understand what I need to do to print all the columns and have the header show up at the appropriate top of every page?
Thanks much!
Answers
Any help please?
Please provide a link to a testpage, as per forum rules. Without it, it'll be impossible for us to do any debugging.
So, I spend several hours trying to find a solution, an hour or so asking for help, wait 10 days, get told to go spend a couple more hours setting up a dummy site so I can get help. But, not a clue on what to do, even with what appears to be clear evidence of the problem.
I'll get right on that.
I tried the basic Print button example:
https://datatables.net/extensions/buttons/examples/print/simple.html
I was able to change between portrait and landscape without issues.
Sometimes a screenshot is enough to help if someone has seen the issue before. If not then being able to see and interact with your code is generally the only way of finding the issue.
Kevin
The print output is highly dependent upon the browser that you are using. What Buttons does is create a simple HTML page that basically contains only a plain HTML table and links to the stylesheets used by the host page. You'll be able to see that in the background of the print dialogue box.
After that, what is actually sent to the printer is completely up to the browser. Most are fairly good at this now, but printing from the web has always been a bit of a nightmare and it is possible there are still browser bugs in this area.
@enjoypb - What browser are you using?
Are you able to reproduce the issue with any of these examples?
Allan
I'm using Chrome myself but users are using the whole array. I ended up removing the PDF button because no matter what I try I can't seem to affect the formatting. When I set the font-size in the print-button config with a smaller font it all appears to be working great. Thanks!