Forums Register Login

Printing only part of the jsf primefaces page

+Pie Number of slices to send: Send

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
+Pie Number of slices to send: Send
Could you post the entire xhtml file please?
+Pie Number of slices to send: Send
sorry i cannot post entire file which is at client site.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
 

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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
You haven't posted the relevant page with all those panels, so we can't really know what is wrong.
1
+Pie Number of slices to send: Send
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).
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 12453 times.
Similar Threads
Issues with scope: JSF-Primefaces
How to uses Java with tags HTML ?
How insert image to primefaces commandbutton?
Navigation works... and it doesn't.
My JSF form won't submit
jar file referring javascript override style
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:40:58.