• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing only part of the jsf primefaces page  RSS feed

 
sai rama krishna
Ranch Hand
Posts: 530
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

I have a print button as below



when i click print button only top half of the page is getting printed and bottom half is pushed to next page. How do i fix this issue.

please advise
Any links resources ideas highly appreciated. Thanks in advance
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post the entire xhtml file please?
 
sai rama krishna
Ranch Hand
Posts: 530
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry i cannot post entire file which is at client site.
 
Tim Holloway
Bartender
Posts: 18715
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PrimeFaces, like all JSF tagsets, renders the actual page as HTML.

HTML is not a good medium for 100% faithful display (or printing) of content. The HTML client (browser) is permitted to do major re-arrangement of the content to accomodate the page to the users specific display.

You can provide greater control over positioning, scaling, and so forth using CSS tags, but for 100% printer fidelity, you would have to select a more rigorous output format, such as PDF.

Note that CSS has the ability to alter rendering based on what media you are outputting to. I use this feature to hide buttons and other things that are meaningless on a printed page.
 
sai rama krishna
Ranch Hand
Posts: 530
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you would have to select a more rigorous output format, such as PDF.


Changing to PDF is a difficult option with our implementation at this stage. Is there is any other alternate way. please advise
 
sai rama krishna
Ranch Hand
Posts: 530
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i referred below link
http://www.primefaces.org/showcase/ui/printer.jsf
I have two separate panel grids with different ids panelGridID1 and panelGridID2 which i need to print out.(which basically avoids header and left navigation menu but only prints these two panel grids alone)


When i gave as below with one panel grid id (panelGridID1 ) it worked perfect.


when i tried to give second panel grid id(panelGridID2) as well to print as below getting error as javax.faces.FacesException: Cannot find component :mainForm:panelGridid2 in view.


can you please advise how to resolve this issue.
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You haven't posted the relevant page with all those panels, so we can't really know what is wrong.
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I stated previously on this topic, it would be helpful to see the XHTML involved. In particular, how the 2 panel grids are defined.

javax.faces.FacesException: Cannot find component :mainForm:panelGridid2


Given your example, the id of the panel grid is panelGridID2, not panelGridid2 (the IDs are case sensitive).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!