RSS

New to JasperReport : Build your first impressive application (part 2)

01 Mar

So now, you’ve seen the 2 previous articles. And now, let’s move on the core of JasperReport and the integration of it to the desktop application. I guarantee you that you really need this article because you don’t want your application only capable to do just System.out.println(“Hello Everybody!”); do you?

Let’s get it on!

1. Building your report
You can see in the right panel, there’s a palette panel. If you can’t see it, go to Window -> Palette to activate palette panel. Drag a static text to the Title Section as follows :

Make it look like this

After that, insert column title into similar like this :

Note : You can add additional line, text, etc as you like.

2. Integrate it with Query
Click on the button with this icon :
You will see a query window. Type this query on the text area (note that this is SQL query, not Hibernate query, JPQL, etc.)

SELECT employee_id AS "E_ID", employee_name AS "E_NAME", salary AS "E_SALARY" FROM employees

Let’s analyze the code above. I’m sure that all of you must be familiar with this code. But one thing you have to know that, in JasperReport, ALIAS will be converted automatically into FIELDS. In this case, you have 3 aliases, E_ID, E_NAME, and E_SALARY. All of these will be converted into JasperReport FIELDS Variable, so that you can place these elements in this design.

Next, place these 3 elements into your design (Dont forget, put these in Details Section), just simply like this :

3. Testing your report
Click on preview button in the toolbar. If you work in the right way, you will see display like this :

The report works fine. Remember, whenever you clicked on Preview, the iReport will automatically compile the report from .jrxml into .jasper. The .jasper file is the generated object that you can use it and directly integrate it with the application.

Note : for iReport 3.7.0 user, you have to change the default language from Groovy to Java. Right click on your report name node in the left side, choose properties, and change the language from Groovy to Java.

Let’s move on to Netbeans.

4. Create a new Java Application Project and Insert JasperReport library
Create the java application first. Uncheck the Create Main Class option. After that, add JasperReport library and MySQL JDBC Driver to your project (Right click on the library node of your project, add new library)as follow :

Add New Library

Add JasperReport library & MySQL JDBC Driver on it. You will see like this once you get done :

Next, create 2 package in your Source Packages, 1 package to place your report, the other one to place your main application. Give it name :

Move your .jasper file into your report package.

Insert a main class into your application package.

5. Code your application

Open your main class, and insert this code to your class (i will explain it component per component) :

package id.hans.employee.application;

import java.awt.Dimension;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.swing.JRViewer;

/**
 *
 * @author Hans Kristanto
 */
public class MainApplication {

    Connection conn = null;

    public void initConnection(){
       
        String HOST = "jdbc:mysql://localhost:3306/DATABASE_NAME";
        String USERNAME = "YOUR_MYSQL_USERNAME";
        String PASSWORD = "YOUR_MYSQL_PASSWORD";
        try {
            Class.forName("com.mysql.jdbc.Driver");
        } catch (ClassNotFoundException ex) {
            ex.printStackTrace();
        }

        try {
            conn = DriverManager.getConnection(HOST, USERNAME, PASSWORD);
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
    }

    public void showReport(){
        
        //Path to your .jasper file in your package
        String reportName = "id/hans/employee/report/EmployeeReport.jasper";
        
        //Get a stream to read the file
        InputStream is = this.getClass().getClassLoader().getResourceAsStream(reportName);

        try {
	 //Fill the report with parameter, connection and the stream reader		
            JasperPrint jp = JasperFillManager.fillReport(is, null, conn);
	    
  	 //Viewer for JasperReport
            JRViewer jv = new JRViewer(jp);
	
	 //Insert viewer to a JFrame to make it showable
            JFrame jf = new JFrame();
            jf.getContentPane().add(jv);
            jf.validate();
            jf.setVisible(true);
            jf.setSize(new Dimension(800,600));
            jf.setLocation(300,100);
            jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        } catch (JRException ex) {
            ex.printStackTrace();
        }
    }

    public static void main(String[] args) {

        MainApplication ma = new MainApplication();
        ma.initConnection();
        ma.showReport();
    }

}

If no problem occured, you will see display like this :

Your Report display. Cool isn't it?

Congratulations! you’ve created your first JasperReport application!

 
78 Comments

Posted by on March 1, 2010 in English, Programming

 

Tags: , , , , , , , ,

78 responses to “New to JasperReport : Build your first impressive application (part 2)

  1. guest

    March 17, 2010 at 3:02 pm

    nice tutorial…well structured and also with clear example…wheew…i wish i found this tutorial 2 years ago…hehe

     
  2. izzid

    March 29, 2010 at 12:34 pm

    thank …

     
  3. iddev

    April 19, 2010 at 12:52 pm

    Thank you, how do I insert an SQL Query in java file not in the report ?

     
  4. Hans Kristanto

    May 19, 2010 at 1:25 pm

    @iddev
    you can add an SQL query, but you can’t compile it first into .jasper file.. let you copy your .jrxml file into your project, add your SQL query, and then everytime you run it, the application should re-compile the report.

     
  5. siva

    June 16, 2010 at 12:05 pm

    Really this article helps for new users who is working on jasper reports.Thanks for the Author.good

     
  6. Rushi

    June 17, 2010 at 5:20 am

    Hi,

    I tried creating a simple report for practice using this tutorial.
    After following ‘2. Integrate it with Query’ step of this tutorial when I tested the report by clicking on preview button, I am getting only first record in a given table.
    Note that I have number of record in my employee table, still I got only 1 record.
    Can you help me with this?

     
  7. Havn

    July 26, 2010 at 9:09 am

    hi ,
    i want change sql query in .jrxml . How can i do ?

     
  8. shohan

    October 25, 2010 at 12:15 pm

    Thanks

     
  9. David

    January 6, 2011 at 3:04 am

    Hi!..

    I triying to make a report but i wanto to use a jpql expression. what can i do ?

    Thanks.

     
  10. LightVision

    August 29, 2011 at 10:45 pm

    Hi,

    Your tutorial are great, thank you!
    Unfortunately is not well indexed. I was struggle-ling 2 weak before finding it.

    Nice and clever!

     
  11. Shean

    August 30, 2011 at 3:54 pm

    How to make I report (jasper) sub report….Plz tel me…

     
  12. josel

    October 9, 2011 at 3:53 am

    i follow your steps. why is it this error occurs?—please help me..

    net.sf.jasperreports.engine.JRException: Error loading object from InputStream
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:198)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:376)
    at id.hans.employee.application.Main.showReport(Main.java:50)
    at id.hans.employee.application.Main.main(Main.java:72)
    Caused by: java.io.StreamCorruptedException: invalid stream header: 3C3F786D
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:782)
    at java.io.ObjectInputStream.(ObjectInputStream.java:279)
    at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.(ContextClassLoaderObjectInputStream.java:53)
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:193)
    … 3 more

    i added the following libraries in my netbeans libraries///

     
  13. Hans Kristanto

    October 9, 2011 at 7:33 am

    Try to check the path for ur .jasper file. This might be due to this.

    Hans Kristanto

     
  14. josel

    October 9, 2011 at 1:54 pm

    i chek the path of my .jasper file already..what do you mean in this line

    //Fill the report with parameter, connection and the stream reader
    52
    JasperPrint jp = JasperFillManager.fillReport(is, null, conn);

    is netbeans 6.9.1, ireport 4.1.2 and your libraries are compatible…thank Hans

     
  15. Hans Kristanto

    October 9, 2011 at 5:00 pm

    the line means, u filling out the report with the inputStream (described as is variable) with the connection that later on can be used to generate the report with the pre-configuration query that u defined. i suspected that your jasperreport version and your ireport version does not match each other. try to download the latest version of jasperreport and as well as the ireport. thanks.

     
  16. josel

    October 9, 2011 at 5:13 pm

    i tried to use the same netbeans version which is netbeans 6.7.1 and irepot 3.7.0 and the same libriries you used..still that error occured..what’s wrong? thanks..

     
  17. Hans Kristanto

    October 9, 2011 at 5:16 pm

    please check the jasperreport version.. this might be mismatch between the jasperreport and ireport version.. netbeans i think should be ok, no issue for this..

     
  18. josel

    October 9, 2011 at 5:37 pm

    i used the latest version of ireport which is 4.1.2 and jasperreport which is 4.1.2 also..but the error still occurs..

    run:
    net.sf.jasperreports.engine.JRException: Error loading object from InputStream
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:215)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:376)
    at id.hans.employee.application.Main.showReport(Main.java:50)
    at id.hans.employee.application.Main.main(Main.java:79)
    Caused by: java.io.StreamCorruptedException: invalid stream header: 3C3F786D
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:782)
    at java.io.ObjectInputStream.(ObjectInputStream.java:279)
    at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.(ContextClassLoaderObjectInputStream.java:53)
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:210)
    … 3 more
    BUILD SUCCESSFUL (total time: 1 second)

    that error always pointing to this line

    JasperPrint jp = JasperFillManager.fillReport(is, null, conn);

    please do help me…

     
  19. Hans Kristanto

    October 9, 2011 at 6:38 pm

    it will pointing to that line because it failed to generate the InputStream from your .jasper file.. please send your project file to me and i will try to check it..

     
  20. josel

    October 9, 2011 at 7:11 pm

    Hans where i will send my project?what is your email. thank you

     
  21. josel

    October 9, 2011 at 10:07 pm

    Hans,

    Thank you..I already solved my problem..I install the ireport plugins in netbeans…

     
  22. Hans Kristanto

    October 9, 2011 at 10:33 pm

    Great! Glad to hear that

    Hans Kristanto

     
  23. Rudolf Damanik Gamelan

    October 12, 2011 at 12:54 pm

    hei. Josel. I have a same problem like yours. Can you tell me how to solve that problem? Because I’m in deadline of presentation of my program that using JasperReport. Thank you so much.

     
  24. Sam

    October 27, 2011 at 1:13 am

    can u pls tell me why do u use this line

    //Get a stream to read the file
    InputStream is = this.getClass().getClassLoader().getResourceAsStream(reportName);

     
  25. Shekhar Kadam

    November 9, 2011 at 1:51 pm

    Thank you so much…………..

     
  26. duong

    November 29, 2011 at 3:11 am

    Hi Hans,
    I have a problem, when I click on button print :

    My PHP1:
    try {
    String reportName1 = “/DHDL/Quanlydiem/Report/report1.jrxml”; // In src folder.
    JOptionPane.showMessageDialog(this,reportName1);
    Connection conn = Config.GetConnection();
    //InputStream is = this.getClass().getClassLoader().getResourceAsStream(reportName1);
    InputStream is1=getInputStream(reportName1);
    //JOptionPane.showMessageDialog(this,is); //Test is
    // JOptionPane.showMessageDialog(this,is1);//Test is1
    // JOptionPane.showMessageDialog(this,conn);
    JasperPrint jasperPrint = JasperFillManager.fillReport(is1, null, conn);
    //JOptionPane.showMessageDialog(this,jasperPrint); //test jasperprin
    JasperViewer jv = new JasperViewer(jasperPrint, false);
    jv.setVisible(true);
    } catch (Exception ex) {
    System.out.println(ex.getMessage());
    }
    Or PHP:

    try {
    ConfigDB Config1 = new ConfigDB();
    JasperReport reporter = JasperCompileManager.compileReport(“report1.jrxml”); // In Quanlydiem folder.
    JasperPrint print=JasperFillManager.fillReport(reporter, null,Config1.GetConnection());
    JasperViewer.viewReport(print);
    } catch (JRException ex) {
    System.out.println(ex.getMessage());
    }

    then have error :
    Null
    or
    No report compiler set for language : null

    I think: JasperPrint print=JasperFillManager.fillReport(reporter, null,Config1.GetConnection()); ———->Null.
    but I still not found this error.
    pls, help me.
    thank you

     
  27. Siddhesh Velangi

    January 2, 2012 at 5:44 pm

    Could you please let me knoe where can i find a good tutorial how to use avanced componets like sort, table. I am unable to find them.

     
  28. supriya

    April 3, 2012 at 1:50 pm

    how can we write java code to generate chart i.e pie chart which is created using jasper report, but want to see on brower.

     
  29. suresh.v

    April 22, 2012 at 5:55 pm

    i got error….
    please give solution

    java.lang.NullPointerException
    at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2264)
    at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2277)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2748)
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780)
    at java.io.ObjectInputStream.(ObjectInputStream.java:280)
    at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.(ContextClassLoaderObjectInputStream.java:53)
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:193)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:376)
    at finalreportapplication.FinalReportApplication.showReport(FinalReportApplication.java:59)
    at finalreportapplication.FinalReportApplication.main(FinalReportApplication.java:81

     
  30. vikas

    May 14, 2012 at 7:35 pm

    Hello Sir, Given Tutorial is very nice and illustrative.Sir I Want to add jasper report fuctionality in jsp page how to do that.Kindly send me the codes in jsp. Thnx in advance

     
  31. vikas

    May 15, 2012 at 8:16 pm

    Hii Sir ,
    I followed ur tutorial and found following error in deploying java code with jasper reports.kindly me out to solve this error. Thnx in advance…..

    Exception in thread “main” net.sf.jasperreports.engine.JRRuntimeException: Unknown hyperlink target 0
    at net.sf.jasperreports.engine.JRHyperlinkHelper.getLinkTarget(JRHyperlinkHelper.java:269)
    at net.sf.jasperreports.engine.base.JRBaseTextField.normalizeLinkTarget(JRBaseTextField.java:313)
    at net.sf.jasperreports.engine.base.JRBaseTextField.readObject(JRBaseTextField.java:377)
    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:1846)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at java.util.ArrayList.readObject(ArrayList.java:593)
    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:1846)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:480)
    at net.sf.jasperreports.engine.base.JRBaseReport.readObject(JRBaseReport.java:742)
    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:1846)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:194)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:376)
    at id.hans.employee.application.MainApplication.showReport(MainApplication.java:49)
    at id.hans.employee.application.MainApplication.main(MainApplication.java:71)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 1 second)

     
  32. Hans Kristanto

    May 16, 2012 at 9:50 am

    Hi There,

    As far as i understand, you can’t use pure jsp file. You have to merge it with either servlet or JSF. Try to google for it🙂

     
  33. vikas

    May 16, 2012 at 12:50 pm

    Hii Sir ,
    plz help me to solve the following error .I followed every step as per ur tutorials instruction but got following error while deploying with java code in netbeans .My jasper reports is working fine and showing data from database.
    I urgently need the solution sir.Plz help me out.
    Thanks and Regards
    vikas pandey

     
  34. vikas

    May 16, 2012 at 12:52 pm

    Hii Sir ,
    plz help me to solve the following error .I followed every step as per ur tutorials instruction but got following error while deploying with java code in netbeans .My jasper reports is working fine and showing data from database.
    I urgently need the solution sir.Plz help me out.
    Thanks and Regards
    vikas pandey

    Exception in thread “main” net.sf.jasperreports.engine.JRRuntimeException: Unknown hyperlink target 0
    at net.sf.jasperreports.engine.JRHyperlinkHelper.getLinkTarget(JRHyperlinkHelper.java:269)
    at net.sf.jasperreports.engine.base.JRBaseTextField.normalizeLinkTarget(JRBaseTextField.java:313)
    at net.sf.jasperreports.engine.base.JRBaseTextField.readObject(JRBaseTextField.java:377)
    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:1846)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at java.util.ArrayList.readObject(ArrayList.java:593)
    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:1846)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:480)
    at net.sf.jasperreports.engine.base.JRBaseReport.readObject(JRBaseReport.java:742)
    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:1846)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:194)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:376)
    at id.hans.employee.application.MainApplication.showReport(MainApplication.java:49)
    at id.hans.employee.application.MainApplication.main(MainApplication.java:71)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 1 second)

     
  35. Hans Kristanto

    May 16, 2012 at 1:08 pm

    have you try to google it? if you try already, you can get the result. this is the link that i get from google :

    http://www.coderanch.com/t/511202/java/java/Unknown-hyperlink-target

     
  36. vikas

    May 16, 2012 at 1:48 pm

    Thnx alot!!!! sir.

     
  37. vikas

    May 16, 2012 at 4:49 pm

    Hello Sir, Thnx a Lot!!!!.I am done with the tutorial and it is working fine .
    Sir,Kindly tell me how can we integrate the jasper report in the web App. I know that we have to add some code to the servlet file but unable to do that.kindly send me the code as I am novice for this field.
    I Needed It badly.Will be Gratefull.
    Thnx in Advance.

     
  38. Manoj

    June 18, 2012 at 4:04 pm

    Sir, Thanks a lot…

     
  39. Manoj

    June 18, 2012 at 4:07 pm

    Sir, you explained us everything in a simply understandable way…
    that helps me lot,
    now i’m trying to reduce the gap between the coloumns,
    Sir, if u can help me for this…
    Thanks again…

     
  40. jasmine

    June 19, 2012 at 10:33 pm

    hello every body ,

    first thakyou for all this,
    i am a beginner, to follow your totorial,i download th elibrary (i am not sur,should i download the src or binaries file),i make all in a directory.
    i open a new application on netbeans,but to add the libraries,i dont know how to do,i choice add library,create but i dont see where to tell location

    can you explian to me please

     
  41. Hans Kristanto

    June 19, 2012 at 10:39 pm

    Hi Jasmine,

    First of all, you need to download the .jar file of the library for jasper report, not the src. The jar file should be located inside of the distribution of the library. After that, if you are building the project with netbeans, go to tools -> library then create new library named “JasperReport” without space, then add the necessary jar file there. After that, add your newly created library in the netbeans then add it to your project. You can follow my tutorial in part 1. If you build using eclipse, then create a folder in your project named “lib” then copy all necessary jar file into it. Then right after you have copied it, add those .jar files into build path by right click in your project then configure your build path to add the library from your dir.

    Hope it will help.

     
  42. jasmine

    June 20, 2012 at 3:00 pm

    hi Hans,

    thank you for replying me,actually i have to create a new java application to test the jasperreport tool (i must product an PDF repport )
    as i undersatnd that’s what you do, do you advise me the part on eof your totorial as a first step?? (i am a little confuse)

    thak you so much

     
  43. Hans Kristanto

    June 20, 2012 at 3:27 pm

    Hi Jasmine,

    Yes, please follow the part 1 step by step to do the setup and preparation.

     
  44. jasmine

    June 21, 2012 at 7:12 pm

    hi Hans,i need your help

    i do first part.now to do the second : i Uncheck the Create Main when i creat ea new application,
    i create a package but i dont know how to add a class main application
    also about the report ,the report that we product in the part1 is an .jrxml (only in preveiw it is .jasper).
    how it can be .jasper in your exemple

    thanks in advance

     
  45. Hans Kristanto

    June 21, 2012 at 7:32 pm

    Hi Jasmine,

    If you want to create main class, create a class which containing :

    public static void main(String[] args)

    The runtime will automatically identify that the class is the main class, so that the JVM will firstly execute this class. Regarding the .jrxml and .jasper, basically those are the same thing. The difference is only with the way the code compile the .jrxml and .jasper into a report file. You can use ireport to design the report and later on when you build, it will produce .jasper file.

     
  46. Shanky

    July 24, 2012 at 7:47 pm

    Thanks ! Sir I have designed the report using IReport 4.6.0 and it was working fine. When I parametrized it and integrated with java in liferay, it gives the error (cvc-complex-type.3.2.2: Attribute ‘uuid’ is not allowed to appear in element ‘jr:column’.) while generating the report.

    Same error even if I use compatibility mode to IReport 4.5.0 and other. But when I use IReport 3.5.0 I get the reports but without DATASETS i.e table and sub-reports, I would be thankful to see the solution to this problem. I have pasted the code below for quick reference:

    public class CompanyPortlet extends MVCPortlet {

    @Override
    public void serveResource(ResourceRequest request, ResourceResponse response)
    throws IOException, PortletException {

    String rType = ParamUtil.getString(request, “reportType”);
    long cid = ParamUtil.getInteger(request, “cid”);

    if (rType != null && rType.equals(“pdf”)) {

    try {

    Context context = new InitialContext();
    DataSource datasource = (DataSource) context
    .lookup(“java:comp/env/jdbc/JasperDBConnection”);
    Connection connection = datasource.getConnection();

    String subReportPath = “D:\\LiferayServer\\reports\\CorperateStrusturesubreport2.jrxml”;
    JasperReport subReport = JasperCompileManager.compileReport(subReportPath);
    InputStream logoImage = getClass().getResourceAsStream(
    “D:\\LiferayServer\\logo1.jpg”);

    Map parameters = new HashMap();
    parameters.put(“company_id”, cid);
    parameters.put(“Image-Stream”, logoImage);
    parameters.put(“SUBREPORT_DIR”, subReport);

    String masterReportPath = “D:\\LiferayServer\\reports\\report3.jrxml”;
    JasperReport masterReport = JasperCompileManager
    .compileReport(masterReportPath);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    JasperPrint jasperPrint = JasperFillManager.fillReport(
    subReport, parameters, connection);
    JasperExportManager.exportReportToPdfStream(jasperPrint, baos);
    JasperPrint jasperPrintMaster = JasperFillManager.fillReport(
    masterReport, parameters, connection);
    JasperExportManager.exportReportToPdfStream(jasperPrintMaster,
    baos);
    response.setContentType(“application/pdf”);
    response.setContentLength(baos.size());

    OutputStream out = response.getPortletOutputStream();

    baos.writeTo(out);
    out.flush();
    out.close();
    connection.close();

    } catch (Exception e2) {
    e2.printStackTrace();
    }
    }
    }
    }

     
  47. swati

    July 25, 2012 at 1:22 pm

    hello sir,
    I want to create the report when user selects a particular date to some other date in form.I am unable to understand how to connect datebox with jasper report so that it can generate a report according to user.Please provide me with simple example.
    I am using jasper ireport 4.6.0 in zk framework with eclipse.
    I am finding very hard to understand..Please help me sir…

     
  48. Hans Kristanto

    July 25, 2012 at 1:34 pm

    Hi Swati,

    if you want to use a specific date, you can use it as a parameter in the report file, which later on you can fill it up from your apps. The parameter itself can be put in the sql query in your report file.

     
  49. swati

    July 25, 2012 at 3:17 pm

    hi..
    this is the code i hv written…
    after clicking report,its responding nthing..
    Please correct this code.
    Any help would be appreciated.

     
  50. Shanky

    July 25, 2012 at 4:41 pm

    Hi sir it would be great if u take a look to this problem and get the solution to this thanks

     
  51. Hans Kristanto

    July 25, 2012 at 5:53 pm

    can you give the full stacktrace?

     
  52. Rama Krishna

    November 27, 2012 at 7:28 pm

    Sir I would like create graph. And It has to be published as a webpage.

    I am working on Stock Quotes Projects using Web Services. After showing the quotes of any Company symbol, I would like to generate a graph using Jasper Reports.
    My Application is similar to Yahoo! Finance.

    How can I do that ?

     
  53. Avinash

    December 12, 2012 at 2:51 pm

    Many Thanks
    It was of lot of help
    I could generate a report with iReport5 with eclipse.

     
  54. lola

    January 11, 2013 at 9:40 am

    Hi plz help i’ve this error…

    Exception in thread “main” java.lang.NullPointerException
    at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2265)
    at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2278)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2749)
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:779)
    at java.io.ObjectInputStream.(ObjectInputStream.java:279)
    at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.(ContextClassLoaderObjectInputStream.java:53)
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:210)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:376)
    at testireport.MainApp.showReport(MainApp.java:46)
    at testireport.MainApp.main(MainApp.java:63)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 0 seconds)

    i have the same ireport and jasperreport versions..don’t know what to do…

     
  55. Hans Kristanto

    January 11, 2013 at 9:50 am

    Can you post the complete stacktrace?

     
  56. lola

    January 11, 2013 at 10:04 am

    sorry sir but what is stacktrace?

     
  57. Hans Kristanto

    January 11, 2013 at 10:53 am

    stack trace is the error stack that you get from the output console.. you have pasted it before, but i need the more complete one to check..

     
  58. lola

    January 11, 2013 at 11:53 am

    ahhhhhmmm that’s all in the outputconsole, nothing more…..

     
  59. hendri

    February 9, 2013 at 9:01 pm

    please help for my error.

    Exception in thread “main” java.lang.NullPointerException
    at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2283)
    at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2296)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2767)
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:798)
    at java.io.ObjectInputStream.(ObjectInputStream.java:298)
    at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.(ContextClassLoaderObjectInputStream.java:53)
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:200)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:376)
    at laporanbelajar.LaporanBelajar.showReport(LaporanBelajar.java:55)
    at laporanbelajar.LaporanBelajar.main(LaporanBelajar.java:80)
    Java Result: 1

     
  60. Raghwendra

    March 3, 2013 at 3:30 am

    Dear Sir,
    Please help me for the error
    run:
    Exception in thread “main” java.lang.NullPointerException
    at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2266)
    at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2279)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2750)
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780)
    at java.io.ObjectInputStream.(ObjectInputStream.java:280)
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:191)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:361)
    at MainApplication.showReport(MainApplication.java:65)
    at MainApplication.main(MainApplication.java:92)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 0 seconds)

     
  61. sagar

    April 15, 2013 at 11:54 am

    Dear Sir,
    Please help me for the error

    java.lang.SecurityException: class “org.apache.commons.collections.ArrayStack”‘s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:776)
    at java.lang.ClassLoader.preDefineClass(ClassLoader.java:488)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2904)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at org.apache.commons.digester.Digester.(Digester.java:137)
    at net.sf.jasperreports.engine.xml.JRXmlDigester.(JRXmlDigester.java:88)
    at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(JRXmlDigesterFactory.java:1108)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:203)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168)
    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152)
    at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:115)
    at com.demo.JasperReportDemo.doGet(JasperReportDemo.java:48)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)

     
  62. Obed Osei Frimpong

    July 24, 2013 at 6:11 pm

    Done!!! Thank you very much!!

     
  63. Vishal

    October 15, 2013 at 2:23 am

    Dear Sir
    Since last 3 days I am trying your code for displaying .jasper on jButton click click event BUT getting a long list of exceptions. Detail of my code –
    I am using Netbeans 7.1, iReport-designer plugin 4.5.0 nbm, jasperreports-4.5.0.jar, commons-beanutils-1.8.2.jar, commons-collections-3.2.1.jar,commons-digester-1.7.jar,commons-logging-1.1.jar,iText-2.1.7.jar these are few more apis which I added to project library.
    Next I have a simple MySQL databse from where I am generating a very simple report just displaying 2 columns in report.
    YES… I am able to see the preview of jrxml as I want, but when I try to view jasper on click event of jButton, from this line of code –
    //Fill the report with parameter, connection and the stream reader
    JasperPrint jp = JasperFillManager.fillReport(is, null, conn);

    I get horrifying error – I check the path of jasper it is
    String reportName = “C:/Users/Vishal/Documents/NetBeansProjects/AirlineResevationSystem/src/newReport.jasper”;

    run:
    Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException
    at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2283)
    at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2296)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2767)
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:798)
    at java.io.ObjectInputStream.(ObjectInputStream.java:298)
    at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.(ContextClassLoaderObjectInputStream.java:53)
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:210)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:376)
    at flightMgm.jButton1ActionPerformed(flightMgm.java:74)
    at flightMgm.access$000(flightMgm.java:13)
    at flightMgm$1.actionPerformed(flightMgm.java:41)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6505)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
    at java.awt.Component.processEvent(Component.java:6270)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4861)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2713)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
    at java.awt.EventQueue.access$000(EventQueue.java:101)
    at java.awt.EventQueue$3.run(EventQueue.java:666)
    at java.awt.EventQueue$3.run(EventQueue.java:664)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:680)
    at java.awt.EventQueue$4.run(EventQueue.java:678)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
    BUILD STOPPED (total time: 11 seconds)

    If you give some time to solve my problem it will great for me, as I have submit my college project other wise I have to leave reporting part.
    Thank you

     
  64. Vishal

    October 15, 2013 at 2:50 pm

    I found the mistake and now I am able to see jasper report on button click, but 1 exception is appearing
    log4j:WARN No appenders could be found for logger (net.sf.jasperreports.extensions.ExtensionsEnvironment).

    log4j:WARN Please initialize the log4j system properly.

     
  65. Hans Kristanto

    October 15, 2013 at 3:37 pm

    You just need to configure your log4j.. you can find how to solve ths on google🙂

     
  66. Vishal

    October 15, 2013 at 6:30 pm

    This is new for me I tried but failed many times, need your guidance.
    Thank you

     
  67. Patrick Waiyego

    October 29, 2013 at 1:30 pm

    Thanks Hans very helpful tutorial:

    Concerning the
    Error:
    Exception in thread “main” java.lang.NullPointerException
    at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2283)
    at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2296)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2767)
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:798)
    at java.io.ObjectInputStream.(ObjectInputStream.java:298)
    at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.(ContextClassLoaderObjectInputStream.java:53)
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:200)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:376)
    at laporanbelajar.LaporanBelajar.showReport(LaporanBelajar.java:55)
    at laporanbelajar.LaporanBelajar.main(LaporanBelajar.java:80)
    Java Result: 1

    firstly ensure that you have the appropriate libraries

    SOLUTION :
    changed: // InputStream is = getClass().getClassLoader().getResourceAsStream(reportName);

    to
    InputStream is = getClass().getResourceAsStream(reportName);

    and worked like a charm!

    Thanks!

     
  68. low fat recipes

    June 5, 2014 at 11:10 pm

    It has figured prominently in many classic baits and
    recipes over the years. The particular problem is always that we need to know
    where you should look for these as not all that come upwards
    during analysis are fantastic. Don’t you just love the reviews and rating systems that give you feedback from
    those who have also tried the recipe.

     
  69. Pete

    July 1, 2014 at 6:55 pm

    hello Hans, everything worked until point 3 but when I connected to the DB, I can see only one record as against 5/6 records…what a i doing wrong? where can i look? can you please help?,

     
  70. Smithd132

    July 29, 2014 at 12:57 pm

    Low cost Gucci Handbags Is generally blogengine much much better than wp for reasons unknown? Should be which is turning out to be popluar today. beagcafbadfkebde

     
  71. Chipenete

    January 14, 2015 at 3:48 pm

    i got no error. thanks

     
  72. Yogesh Kumbhar

    January 26, 2015 at 5:04 pm

    InputStream is = this.getClass().getClassLoader().getResourceAsStream(reportName);
    returns null in my project

     
  73. Soumya

    October 13, 2015 at 8:54 pm

    How to integrate ireport with my eclipse-based Web Project.Thnx in advance.

     
  74. Heera

    October 28, 2015 at 1:20 pm

    i am using Eclipse. I have installed Jsaper studio 6.1.1 plugin in my eclipse and also using jasperreport 6.1.1 jar file and all the above mentioned jar files in my project. I am getting the following error.

    Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ReferenceMap
    at net.sf.jasperreports.engine.design.JRAbstractJavaCompiler.(JRAbstractJavaCompiler.java:74)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at net.sf.jasperreports.engine.JasperCompileManager.getCompiler(JasperCompileManager.java:823)
    at net.sf.jasperreports.engine.JasperCompileManager.getEvaluator(JasperCompileManager.java:380)
    at net.sf.jasperreports.engine.fill.JRFillDataset.createCalculator(JRFillDataset.java:467)
    at net.sf.jasperreports.engine.fill.BaseReportFiller.(BaseReportFiller.java:152)
    at net.sf.jasperreports.engine.fill.JRBaseFiller.(JRBaseFiller.java:236)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:72)
    at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:60)
    at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:201)
    at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:216)
    at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:85)
    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:456)
    at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:417)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:838)
    at id.hans.employee.application.MainApplication.showReport(MainApplication.java:59)
    at id.hans.employee.application.MainApplication.main(MainApplication.java:83)
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.map.ReferenceMap
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

     
  75. Heera

    October 28, 2015 at 1:56 pm

    i found out the solution.When i upgraded my commons. collection to 3.2.1 it worked. Thanks fot the tutorial🙂

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: