0

I have a page where, when the button is clicked, the page will be printed. I am using the code below on the "On Click" extended property. Now the problem is that it prints the whole page. For example the title, menu bar, login info, everything! How can I omit those, and only print whatever is in the main content section. Any help is greatly appreciated. Thanks

"window.print(); return false;"
Hanno
  • 467
  • 11
  • 21
trx
  • 2,077
  • 9
  • 48
  • 97

1 Answers1

2

I believe the answer isn't OutSystems specific. Have a look at this question where they provide an answer you might want to try...

Here's a snippet of the answer: In Chrome it's possible to hide this automatic header/footer using:

@page { margin: 0; }

Since the contents will extend to page's limits, the page printing header/footer will be absent. You should, of course, in this case, set some margins/paddings in your body element so that the content won't extend all the way to the page's edge. Since common printers just can't get no-margins printing and it's probably not what you want, you should use something like this:

@media print {
  @page { margin: 0; }
  body { margin: 1.6cm; }
}
Community
  • 1
  • 1