• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

generate report in pdf format through a JSP page

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to generate report in pdf format through a JSP page. How can i do it ?
 
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sanskriti,

Check out iText API. I think that would help you in creating "on the fly" pdfs.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Check out this tutorial
 
sanskriti agarwal
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do JasperReport Library work for jdk1.4 or older versions.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The "JasperReports Datasheet" on the Jasper home page answers that.
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are using Netbeans IDE then better go for Jasper reports --iReports
 
reply
    Bookmark Topic Watch Topic
  • New Topic