Solved

Printing only part of the jsf primefaces page

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

910 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

19 Experts available now in Live!

Get 1:1 Help Now