Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How can i generate PDF from JSF

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am new to JSF. I want to generate PDF from JSF. I have data in h:dataTable in JSF and i want to add this data to the PDF Document table.
Please can any one help me.



Thanks in advance
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at itext.
 
Aiswarya Geidth
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for response.

I was seen that iText and i am able to implement that one in SERVLET and in JSP but not in JSF.
So, i want to generate PDF on fly in JSF when clicking on a link.


Thanks
 
Saloon Keeper
Posts: 6592
161
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For tabular data I'd check out DisplayTag: http://www.displaytag.org/
 
Rok Koncina
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I gave you a fast answer that wasn't complete.
With Jboss Seam you can create a pdf in the similar way you create classic jsf page.
http://docs.jboss.com/seam/latest/reference/en-US/html/itext.html

You can fill this "page" with data the same way you fill the displayed jsf page. Than all you need is a link to this page and you'll get a pdf.
 
Aiswarya Geidth
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the solutions.

I got solution for my problem. In normal java bean i used response.setHeader using FacesContext.



Thanks
 
Of course, I found a very beautiful couch. Definitely. And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic