java2db

How to open jasper Report in excel format from java



To open jasper Report in excel format from java stand alone application , we need to add additional jar files to the class path . In case of IDE , add jar files to the libraries . The basic requirements to open jasper Report in excel format as follows .

open jasper Report in excel format Softwares

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

open jasper Report in excel format 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 files version depends on the software version .

open jasper Report in excel format Files
.java or .class file
.jasper file

 

Process to open jasper Report in excel format :

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

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

…….with the  select query .

open jasper Report in excel format Add the jar files to the class path , or add to libraries if you are working with IDE .

 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 jasper Report in excel format from java :

From the above example code :

open jasper Report in excel format The .jasper file name is javaReportCall.jasper .

open jasper Report in excel formatC:/javareportCall/”  is the location of the   javaReportCall.jasper  file.

open jasper Report in excel format First it will create the report.xlsx (line 58 , we mentioned the excel sheet name and location).

The method Runtime.getRuntime().exec(“”) will open the excel sheet (report.xlsx) , from the

……specific  location .

If the Connection object is null , it will open the excel sheet  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]



^ <