• Post Reply Bookmark Topic Watch Topic
  • New Topic

How we can generate PDF file for <rich:datatable> data using JSF 2.0 ??

 
Parveen thakur
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Please help and suggest me. I want to print the data of datatable into pdf format using jsf 2.0 as shown in image . If i click on the link pdf then the same copy of data is generated in PDFs format.

using jsf2.0 .I am using <h:panelGrid columns="1" id="baseConfigList" style="FONT-FAMILY: 'Andale Mono'; width:750px">
<rich:dataTable ........................
............................
</rich:dataTable>
</h:panelGrid>

Remark: Please suggest me how i can show the data of datatable into pdf file. Without Seam.

Thanks In advance.

datatable.jpg
[Thumbnail for datatable.jpg]
DataTable
 
Tim Holloway
Bartender
Posts: 18413
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should not use JSF to generate PDF or other non-HTML files. People keep trying to do this and it works very badly when it works at all, because PDF and HTML are very, very different, and JSF's default renderer is set up for HTML. Use a servlet to generate the PDF, instead. If your JSF backing bean is at session scope or higher, your servlet can read its row data by obtaining the backing bean directly since JSF session-scope beans and J2EE session-scope beans are exactly the same thing, other than how they get initially constructed.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!