Solved

Printing only part of the jsf primefaces page

Posted on 2014-01-15
2
2,617 Views
Last Modified: 2014-03-14
Hi,

I have a print button as below

  <p:commandButton id="printit" value="Print" type="button" icon="icn-print">
                    <p:printer target=":topForm:data" />
                </p:commandButton>

Open in new window


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
0
Comment
Question by:gudii9
2 Comments
 
LVL 7

Accepted Solution

by:
gudii9 earned 0 total points
ID: 39805204
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.


<p:commandButton id="printId" value="Print Me" type="button" icon="printicon">
<p:printer target=":mainForm:panelGridID1" />
</p:commandButton
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.

<p:commandButton id="printId" value="Print Me" type="button" icon="printicon">
<p:printer target=":mainForm:panelGridID1" />
<p:printer target=":mainForm:panelGridID2" />
</p:commandButton

can you please advise how to resolve this issue.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
servlet  URL Rewriting 1 42
eclipse with Angularjs2.0 3 57
Desingning Refactoring existing code 2 26
jsp error 6 26
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question