• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

generate report in pdf format through a JSP page

 
sanskriti agarwal
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to generate report in pdf format through a JSP page. How can i do it ?
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sanskriti,

Check out iText API. I think that would help you in creating "on the fly" pdfs.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The other major open source PDF document creation toolkit is the Apache FOP project.

You should NOT think of this as a JSP problem. Your JSP might be involved in creating a form to get parameters and providing a link to download the finished document, but thats it.

There are lots of details to iron out first. Put your PDF creation in a plain Java object which can be tested outside the servlet/jsp environment.

Bill
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Check out this tutorial
 
sanskriti agarwal
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for so helpful and fast replies.

I used iText.jar for PDF generation but now i am getting this error ...

java.lang.UnsupportedClassVersionError: ggs/erm/beans/setup/roled/RolesHome (Unsupported major.minor version 48.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code))
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:432)
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:392)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:248)
at com.ibm.ws.classloader.EJBJarClassLoader.preloadInterfaces(EJBJarClassLoader.java:55)
at com.ibm.ws.classloader.ClassLoaderManager.lookupClassLoader(ClassLoaderManager.java:239)
at com.ibm.ws.runtime.Server.getClassLoader(Server.java:867)
at com.ibm.ws.runtime.EJBEngine.addEjbModule(EJBEngine.java:381)
at com.ibm.ws.runtime.Server.startModule(Server.java:608)
at com.ibm.ws.runtime.StandardServer.initializeModules(StandardServer.java:321)
at com.ibm.ws.runtime.StandardServer.initializeRuntime0(StandardServer.java:349)
at com.ibm.ws.runtime.Server.initializeRuntime(Server.java:885)
at com.ibm.ws.runtime.StandardServer.main(StandardServer.java:519)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:158)
at com.ibm.etools.websphere.tools.runner.api.ServerRunnerV4$1.run(ServerRunnerV4.java:56)
and it is even not starting Application....What should i do? I have jdk1.5 installed .and iText is 1.5.2 version.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're getting a JDK/JRE version conflict. You'll want to make sure that you're compiling your code with the same JDK (or at least have the compatibility settings on)
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As an alternative to iText you might want to check out the JasperReports library. PDF is one of the output formats it supports.
 
sanskriti agarwal
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do JasperReport Library work for jdk1.4 or older versions.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "JasperReports Datasheet" on the Jasper home page answers that.
 
binu narayanan
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using Netbeans IDE then better go for Jasper reports --iReports
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic