1

I have a custom control ( which lays on an xpage ) having some buttons and a view panel: viewPanel1.

I want to print JUST the data from this view panel, but not the entire window using window.print();.

In classic lotus notes I used: @Command([FilePrint]; "1"; ""; ""; ""; "printview";""; "";"";"")

Is there any possibility achieving this using javascript? I want to create a button for the printing.

Thanks for your time.

Florin M.
  • 2,159
  • 4
  • 39
  • 97
  • One option about printing only part of the page is CSS. See this question: http://stackoverflow.com/questions/3463796/how-to-only-show-certain-parts-with-css-for-print – Lauri Laanti May 15 '14 at 06:59

1 Answers1

2

You need to add (or create) a stylesheet that uses @media print.

Here's a specific OneUI 2.1 example taken from this XSnippet:

@media print { 
  .lotusBanner, .lotusTitleBar, .lotusColLeft, .lotusActionBar, .lotusFooter, .lotusLegal {
    display: none;
  } 
  .lotusMain, .lotusMain .lotusContent, .xspInputFieldRichText {
    border: none;
  }
  .lotusFrame {
    width: 100%;
  }
  @page { margin: 0.5cm; }
}
Per Henrik Lausten
  • 21,331
  • 3
  • 29
  • 76