tumblr counter

Call Jasper Report / Ireport From Java Application

Call Jasper Report / Ireport From Java Application Example describes about How to call Jasper Report and Ireport from a java application.

Jasper-Reports is a free reporting engine that could be written to screen, or to a printer or as HTML, PDF, RTF, Microsoft Excel, XML files, CSV format and ODT files.

Jasper-Report is using in Java related applications, including Web and Enterprise applications, to develop dynamic reports. It reads its instructions from jasper file (compiled) or XML dynamically

We can generate reports using two ways,

1) From "JRXML" (Source) file
2) From "Jasper" (Compiled) file
 

Required Libraries

You need to download

  1. JDK 6
  2. iReport-4.1.1 for designing the report

Following jar must be in classpath (Available from ireport installation directory)

  1. commons-beanutils-1.8.2.jar
  2. commons-collections-3.2.1.jar
  3. commons-digester-1.7.jar
  4. commons-logging-1.1.jar
  5. groovy-all-1.7.5.jar
  6. iText-2.1.7.jar
  7. jasperreports-4.1.1.jar
Note

If you are created a JRXML/Jasper file using a particular version of Ireport (For example consider Ireport-4.7.0)

In order to run the report, you must use same set of jar's available on installed Ireport-4.7.0 directory (C:\Program Files\Jaspersoft\iReport-4.7.0\ireport\modules\ext)

If you are creating a report using Ireport-4.7.0 and compiling / running using Ireport-4.2.0 jar files, you will get java.lang.NullPointerException

Create PDF Report From JRXML File

JRXML file is a JasperReports Document. JRXML is the XML file format of JasperReport, which can be coded manually, generated, or created using a tools like IReport, JasperAssistant etc

Execution of report from JRXML file will be very slow, as it need to compile before the execution

import java.io.IOException;
import java.util.HashMap;

import net.sf.jasperreports.engine.JREmptyDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;

// Java Program To Call Jasper Report

public class PdfFromXmlFile {
 
public static void main(String[] args) throws JRException, IOException {
   
   
JasperReport jasperReport = JasperCompileManager.compileReport("report.jrxml");
    JasperPrint jasperPrint = JasperFillManager.fillReport
(jasperReport,new HashMap(), new JREmptyDataSource());
    JasperExportManager.exportReportToPdfFile
(jasperPrint, "sample.pdf");
 
}
}

Create PDF Report From Jasper File

Jasper file is a compiled format of JasperReports Document.

Execution of report from Jasper file will be very fast, as it is pre-compiled

It is recommended for the production environment

import java.io.IOException;
import java.util.HashMap;

import net.sf.jasperreports.engine.JREmptyDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;

// How To Invoke Ireport From Java Application

public class PdfFromJasperFile {
 
public static void main(String[] args) throws JRException, IOException {

   
JasperPrint jasperPrint = JasperFillManager.fillReport("report.jasper"new HashMap<String, Object>(),
   
new JREmptyDataSource());
    JasperExportManager.exportReportToPdfFile
(jasperPrint, "sample.pdf");

 
}
}



How To Call Jasper Report Java Program To Call Jasper Report Call Jasper Reports From Java How To Call Ireport From Java Application How To Invoke Ireport From Java Application Calling Ireport From Java Java Ireport Tutorial

You might also like following tutorials :

Java Tutorial Apache CXF Tutorial Hibernate Tutorial Spring Tutorial Struts Tutorial
31 Comments on "Call Jasper Report / Ireport From Java Application"
09.07.2012 18:48:42 pradhumna
hi 
could you let me know what are report.jrxml, report.jasper,sample.pdf ? 
Are they predefined R our own files inthis program /
10.07.2012 18:51:21 Coolashy1510
Hi
I tried copying the same and changed only the name of the jasper file. yet there is an exception..

Exception in thread main java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    at net.sf.jasperreports.engine.util.JRLoader.(JRLoader.java:61)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:536)
    at MyReportViewer.main(MyReportViewer.java:13)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 3 more


please help 
11.07.2012 17:49:22 admin
@pradhumna report.jrxml file is created using Ireport designer, report.jasper is a compiled format of report.jrxml, if you have both then you can generate pdf according the design template (report.jrxml)

@Coolashy1510 you need to have commons-logging-1.1.jar in your classpath
11.07.2012 18:53:12 Sherin Matheew
Hi,
Have checked if you have all the below mentioned jar file in  the lib folder of your server
1.commons-beanutils-1.8.2.jar2.commons-collections-3.2.1.jar3.commons-digester-1.7.jar4.commons-logging-1.1.jar5.groovy-all-1.7.5.jar6.iText-2.1.7.jar7.jasperreports-4.1.1.jar
24.08.2012 12:03:30 Swapnil Shirsat
I got those jars but still i m getting exceptions. but i am using ireport 4.7.0 version
24.08.2012 17:03:58 admin
What exceptions are you getting? can you provide exception stack?
24.08.2012 19:03:02 Swapnil Shirsat
Those whose code is running can u give the path from where you got all this jars
12.09.2012 18:34:30 DeD
Hi all; 
I tried it, I downloaded all the .jar files but i'm still getting exceptions :

xception in thread main java.lang.NullPointerException
    at net.sf.jasperreports.engine.JRPropertiesMap.readObject(JRPropertiesMap.java:185)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1666)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1322)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1666)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1322)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:88)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:515)
    at javaapplication2.JavaApplication2.main(JavaApplication2.java:16)
 
14.09.2012 17:53:07 admin
@Swapnil Shirsat
@DeD

If you are created a report using Ireport-4.7.0
you must use the same jar files available from installed Ireport-4.7.0  directory

All jar available on this folder
C:\Program Files\Jaspersoft\iReport-4.7.0\ireport\modules\ext

you can't use iReport-4.7.0 with old jar files, in that case you will get java.lang.NullPointerException
16.09.2012 18:31:25 Hardik Mishra
Hey This is really helpful. I have used this. In my case I am passing Map with parameters and .jrxml have those parameters defined. But, I am getting blank PDF.
18.09.2012 18:32:35 admin
Without checking .jrxml, I cant say the problem, can I get your jrxml file, you can sent to 
info@javatips.net
25.09.2012 18:28:39 haris
pls send that jar files link
26.09.2012 18:27:42 admin
if you installed Ireport, you will get all the jar's inside below folder
C:\Program Files\Jaspersoft\iReport-4.7.0\ireport\modules\ext 
21.11.2012 18:37:52 somphas
i got jassper-4.7.1.jar and m using ireport-4.7.1 too but it still got this message  Exception in thread AWT-EventQueue-0 java.lang.NullPointerException what's the problem ???
04.09.2013 14:43:22 Felipe
Hi, I used your .jasper solution and I can complie and generate the pdf but it always comes null. I think it's not connecting right with the DB. Can you help me out?
08.10.2013 04:38:48 dipesh bhavsar
Hi. Thanks for this nice tutorial. I am able to export PDF from my jrxml/jasper. but now I have requirement to export the same in PS file (PostScript) file format. is it possible using jrxml or i need to use some other technology.

Please suggest.
21.10.2013 00:55:31 chitra
Hi,Thanks for this nice Tutorial.
i got error like  Docment root type  null when my ireport is used in java code.
but that ireport work well in ireportdesigner 4.0.1.
21.10.2013 23:28:27 admin
@chitra,

On this example, i am using JREmptyDataSource which only helps on static data, 
if you need dynamic report then you need to pass the exact datasource or connection into JasperFillManager

JasperPrint jasperPrint = JasperFillManager.fillReport(report.jasper,  new HashMap(),
new JREmptyDataSource());
12.11.2013 01:36:13 prabhu
Hi, I need integrate jaspersoft into my eclipse and i want to access jasper report in existing wed application
14.11.2013 02:19:01 admin
@prabhu,

If you need to configure jasper reports with eclipse, you can try any of the following tools

1) Jaspersoft Studio
2) JasperAssistant
20.01.2014 11:26:31 Prasad
I had created a report using i report. But it displays me a blank page..

This is my code.....

public void report(){
    
    String jasperFileName = C:/Users/PRASSAD/Documents/vgquenim/src/report/report2.jasper;
  
    try {
            String reportSource = C:/Users/PRASSAD/Documents/vgquenim/src/report/report2.jrxml;
             
            Map params = new HashMap();
          
            JasperReport jasperReport = JasperCompileManager.compileReport(reportSource);
             System.out.println(jasperReport);
            JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params, new JREmptyDataSource());
            System.out.println(jasperPrint);
            JasperViewer.viewReport(jasperPrint, false);
            
            
            JasperPrint jprint = (JasperPrint) JasperFillManager.fillReport(jasperFileName, params, con);
      System.out.println(jprint);
   // Export pdf file
   JasperExportManager.exportReportToPdfFile(jprint, C:abc.pdf);

   System.out.println(Done exporting reports to pdf);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }



This is the error i get

run:
Connected Successfully
Connected Successfully
C:/Users/PRASSAD/Documents/vgquenim/src/report/report2.jasper
C:/Users/PRASSAD/Documents/vgquenim/src/report/report2.jrxml
{}

14/01/20 12:09:08 WARN component.ComponentsEnvironment: Found two components for namespace http://jasperreports.sourceforge.net/htmlcomponent
14/01/20 12:09:08 WARN component.ComponentsEnvironment: Found two components for namespace http://jasperreports.sourceforge.net/htmlcomponent
14/01/20 12:09:08 WARN component.ComponentsEnvironment: Found two components for namespace http://jasperreports.sourceforge.net/htmlcomponent
net.sf.jasperreports.engine.JasperPrint@a9014d
14/01/20 12:09:13 WARN query.JRJdbcQueryExecuter: The supplied java.sql.Connection object is null.
net.sf.jasperreports.engine.JasperPrint@1151346
Done exporting reports to pdf
25.01.2014 00:06:56 admin
@Prasad,

If you need to have actual data displayed, then you need to replace new JREmptyDataSource() with actual DataSource.
Currently the supplied java.sql.Connection object is null, Please check this too,
03.03.2014 04:46:38 iman
Hi,Thanks for this nice Tutorial 
i create my pdf from ireport 4.7.0 with xml datasource but i have this error 

This is my code



*************************************************
import java.io.IOException;
import java.util.HashMap;
import java.util.jar.JarException;

import net.sf.jasperreports.engine.xml.*;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.data.JRXmlDataSource;

// Java Program To Call Jasper Report
public class xmlToPdf { 

public static void main(String[] args) throws JarException, IOException, JRException {
   
	JasperReport jasperReport = JasperCompileManager.compileReport(C:/Users/user/Desktop/rapport.jrxml);
    JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,new HashMap(), new JRXmlDataSource(C:/Users/imen.zayeni/Desktop/rapport.xml));
    JasperExportManager.exportReportToPdfFile(jasperPrint, C:/Users/user/Desktop/rapport.pdf);
  }
}
***************************************************
i get this message:

Exception in thread main net.sf.jasperreports.engine.JRException: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.
	at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:251)
	at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:230)
	at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:218)
	at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:172)
	at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:156)
	at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:171)
	at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:448)
	at xmlToPdf.main(xmlToPdf.java:20)
Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.
	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanData(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanCDATASection(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.apache.commons.digester.Digester.parse(Digester.java:1892)
	at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:243)
	... 7 more

Can you help me out please ?
03.03.2014 11:20:58 admin
@iman,
 
Your jasper datasource (rapport.xml) is not supporting UTF-8 charset. please check following thread.

http://community.jaspersoft.com/questions/523768/netsfjasperreportsenginejrexception
04.03.2014 04:12:37 iman
thanks admin for your help  :) 
10.07.2014 16:46:39 Asim
Hi Admin i'm having a problem in calling a Matrix report in ireport please help.

javax.xml.ws.soap.SOAPFaultException: Error executing SQL statement for : jasper_report_template
	at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
	at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:119)
	at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
	at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
	at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
	at $Proxy1306.prepareBudgetPLReport(Unknown Source)
	at pk.com.softech.backconnect.budgetsys.BudgetMatrixReportBean.print(BudgetMatrixReportBean.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.el.parser.AstValue.invoke(AstValue.java:172)
	at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
	at javax.faces.component.UICommand.broadcast(UICommand.java:315)
	at javax.faces.component.UIData.broadcast(UIData.java:1093)
	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:619)
Caused by: net.sf.jasperreports.engine.JRException: Error executing SQL statement for : jasper_report_template
	at com.jaspersoft.jrx.query.PlSqlQueryExecuter.createDatasource(PlSqlQueryExecuter.java:143)
	at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1087)
	at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:668)
	at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1281)
	at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:900)
	at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:845)
	at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:61)
	at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446)
	at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:849)
	at pk.com.softech.backconnect.budgetsys.dao.BudgetMatrixReportDao.prepareBudgetPLReport(BudgetMatrixReportDao.java:118)
	at pk.com.softech.backconnect.ws.BackConnectWS.prepareBudgetPLReport(BackConnectWS.java:996)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
	at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
	at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
	at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:95)
	at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:629)
	at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
	at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
	at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
	at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:295)
	at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:515)
	at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:285)
	at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:143)
	at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:155)
	at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:189)
	at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:76)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	... 15 more
Caused by: java.sql.SQLException: Cursor is closed.
	at oracle.jdbc.driver.T4CResultSetAccessor.getCursor(T4CResultSetAccessor.java:323)
	at oracle.jdbc.driver.ResultSetAccessor.getObject(ResultSetAccessor.java:85)
	at oracle.jdbc.driver.OracleCallableStatement.getObject(OracleCallableStatement.java:1401)
	at com.jaspersoft.jrx.query.PlSqlQueryExecuter.createDatasource(PlSqlQueryExecuter.java:131)
	... 46 more
11.07.2014 08:27:13 admin
@Asim,

This exception Caused by: java.sql.SQLException: Cursor is closed. And not related to jasper report. So please correct the SQL query
24.07.2014 20:01:58 senn2007
Hi Admin,

I have implied the same coding i was using JRXML file.

I get this following error

log4j:WARN No appenders could be found for logger (net.sf.jasperreports.engine.xml.JRXmlDigesterFactory).
log4j:WARN Please initialize the log4j system properly.

my code is 

public void PDF(ActionEvent actionEvent) throws JRException{
		
		JasperReport jasperReport = JasperCompileManager.compileReport(C:/Users/Senthil/JaspersoftWorkspace/MyReports/NewFriend.jrxml);
		JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,new HashMap(), new JREmptyDataSource());
		JasperExportManager.exportReportToPdfFile(jasperPrint, sample.pdf);
	
	}
04.11.2014 15:09:25 admin
@senn;

It is only warnings related to log4j tool and not related to JasperReport
17.11.2014 12:15:54 Sasindu
[AWT-EventQueue-0] WARN query.JRJdbcQueryExecuter  - The supplied java.sql.Connection object is null.
????Need Help
17.11.2014 20:15:52 admin
@Sasindu,

Please check your JDBC Connection object, it is getting null
need more stack trace for finding the exact cause.