aspose file tools*
The moose likes Other Open Source Projects and the fly likes generate report in pdf format through a JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "generate report in pdf format through a JSP page" Watch "generate report in pdf format through a JSP page" New topic
Author

generate report in pdf format through a JSP page

sanskriti agarwal
Greenhorn

Joined: Dec 31, 2007
Posts: 13
I need to generate report in pdf format through a JSP page. How can i do it ?


SANSKRITI AGARWAL
[SCJP 1.5 -88%] Software Developer, Global Groupware Software Solutions Ltd., India
Vishwanath Krishnamurthi
Ranch Hand

Joined: Jun 04, 2007
Posts: 331
Hi Sanskriti,

Check out iText API. I think that would help you in creating "on the fly" pdfs.


Blog
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12785
    
    5
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

Joined: Jun 04, 2007
Posts: 331


Check out this tutorial
sanskriti agarwal
Greenhorn

Joined: Dec 31, 2007
Posts: 13
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

Joined: Jun 24, 2003
Posts: 3274
    
    5

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)


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41863
    
  63
As an alternative to iText you might want to check out the JasperReports library. PDF is one of the output formats it supports.


Ping & DNS - my free Android networking tools app
sanskriti agarwal
Greenhorn

Joined: Dec 31, 2007
Posts: 13
Do JasperReport Library work for jdk1.4 or older versions.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41863
    
  63
The "JasperReports Datasheet" on the Jasper home page answers that.
binu narayanan
Ranch Hand

Joined: Jul 24, 2009
Posts: 56
If you are using Netbeans IDE then better go for Jasper reports --iReports
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: generate report in pdf format through a JSP page