java2db

How to open pdf iReport from java example



To open pdf iReport from java  stand alone , we need to add additional jar file to the class path . In  IDE , add the jar files to libraries . The basic requirements , to open pdf iReport from java as follows .

 

open Pdf iReport from java Softwares

Java  (Download java ) .
iReport Designer (Download iReport Designer) .
Database  (Ex : Oracle,Db2 ,MySql …) .

open Pdf iReport from java Jar files

commons-beanutils-1.8.2.jar
commons-collections-3.2.1.jar
commons-digester-1.7.jar
commons-logging-1.1.jar
groovy-all-1.8.0.jar
iText-2.1.7.jar
jasperreports-5.2.0.jar

Also add Specific  database jars (Ex : If it is oracle add ojdbc14.jar )
Note : Jar file version may change , based on the software version .

open Pdf iReport from java Files
.java or .class file
.jasper file

 

Process to open pdf iReport from java :

open Pdf iReport from java Create table in the database and insert few records .

open Pdf iReport from java Create .jasper file from the iReport designer tool   (Design and compile .jrxml , it gives  .jasper file) .

open Pdf iReport from java Add the jar files to the class path , or add to libraries if you are working wiht  IDE .

open Pdf iReport from java Create and run the Java classes .

 

Note : If the report is using Empty Datasource ,no need of database software and supported jar files .

 

Example code to open pdf iReport from java :

 

ReportImpl.java  file .

open Pdf iReport from java In the above example, The  .jasper file name is  javaCallReport.jasper .

open Pdf iReport from java The method  Runtime.getRuntime().exec(“”)  is to open  pdf file (sample.pdf) , which is already created  by java in the specified location .

open Pdf iReport from java If the Connection object is null , it will open the pdf report with null values .( like Empty datasource report ).




Related Posts :
How to Connect to Oracle from Liferay portlet ( Java Liferay and Oracle integration )
How to Connect Liferay 7 to PostgreSQL ( Java Liferay portlet and PostgreSQL integration )
How to call C# .Net WCF web service in java SOAP client ( Visual Studio 2013 )
How to call PHP RESTful web service in java client
How to call java SOAP web service in php ( php web service client )
Solution to SSLHandshakeException (skip the certificate for Java and LDAP bind)
Java RESTful web service example in maven using JAX-RS
RESTful web service example in java using JAX-RS
   [will not be published]



^ <