This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jan 11, 2013, 10:20 PM
37 Posts
topic has been resolvedResolved

Creating a "print page" & the Application Layout

  • Category: Styles and Themes
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 4
 Hello, all!
 
   With XPages, I was wondering which was the best method for a LONG printer friendly form, which uses an ApplicationLayout?  While I abhor printing, it is needed for this project.  Here is what I have so far:
 
1.  John Jardin, of Ukuvuma, shared a nice article on how to do it with either jQuery or dojo.  While this will work, it is a long form, and may need to be a long script for something that should really be pretty simple.
2.  Use CSS' @media print.  It's working so far, but again, it's the ApplicationLayout that I am having issues in trying to hide the banner, utility links, etc...  Custom controls don't have a "styleClass", but any other controls can hold the "noPrint" style, which prevents it from printing.  Very easy!  But, how do I do it with custom controls and within the ApplicationLayout?
3.  For the main form, move it all to a custom control.  Have one XPage for users, and another "print friendly" XPage that just has the main custom control and only shows in read mode.
 
Anyone else have any ideas?
 
Wouldn't it be great if each control had a "hide when printing" option, like in Notes?  Then, just have the @media print display:none style in a CSS on the server that would do the work for us?  Hmm...
 
Thanks, in advance, and have a good weekend! 
 
Steve in NYC 
 
"It hurts to be on the cutting edge." 
Jan 11, 2013, 11:51 PM
366 Posts
Re: Creating a "print page" & the Application Layout
 Probably not the solution you are looking for, but when I'm "required" to provide print, then I actually create a PDF using an XAgent and Apache FOP of the print output. 
 
It's not as simple as "just print" but allows more flexibility of the output which, in my experience anyway, requires reformatting for print output anyway. 
 
 
Jan 14, 2013, 2:15 PM
37 Posts
Re: Creating a "print page" & the Application Layout
 Thanks, Paul!
 
   You're right in that it's not the answer I was looking for.  :-) 
 
   This is an extremely long form, and already looks nice if I can remove the extra ApplicationLayout portions.  I did see your webcast about using Apache FOP over iText, as well.  If I do decide to create a PDF, how about appending all the PDF attachments to the end of the PDF?  Can that be done with Apache FOP, or would I need iText?
 
   This does seem like overkill, but if the PDF can contain all the other attachments for one big PDF, then maybe it can work. 
 
Any ideas? 
 
Thanks! 
 
Steve in NYC 
Jan 14, 2013, 2:24 PM
298 Posts
I think your option 3 is best
Many sites have a "print" button that opens the same page formatted differently in a new browser window. The users could print from the window that displays an XPage with no app layout or any navigation. Then, they close the window and are back where they started. Howard
Jan 14, 2013, 3:19 PM
37 Posts
Re: Creating a "print page" & the Application Layout
 Thanks, Howard!
 
   So, your vote is for option #3, which is probably the simpler option.  I just wish that each control had an option not to print, since it's been there for the Notes client and would be easy enough to do in the official IBM themes, that get shipped out, I would think.  Maybe I can do something for it, if I knew where to do it.  =8P
 
   For a simple "print" option, I'll do option #3.  They'll want another choice to print the entire case, which will include all the PDF attachments.  For this, I'll see if I can use one of the iText OpenNTF custom controls where I can export the XPage to a PDF, then attach each PDF to it for one big fat PDF!
 
Thanks! 
 
Steve in NYC 
 
"Indecision is the key to flexibility." 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal