Solved

Printing only part of the jsf primefaces page

Posted on 2014-01-15
2
2,439 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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…
The viewer will learn how to implement Singleton Design Pattern in Java.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now