Results 1 to 4 of 4
  1. #1
    realosso is offline Member
    Join Date
    Jun 2010
    Posts
    5
    Rep Power
    0

    Default jasper report problem

    Hi,
    I've created a report in jasperReport. I want to view and print this report from my java code. But it gives exception. Code as follows, where there are errors?

    Java Code:
    public void runReport() {
          try{
              st = connectDB();
              res = st.executeQuery("SELECT * FROM Kayitlar");
    
              JRResultSetDataSource jrRS = new JRResultSetDataSource( res );
              Map parameters = new HashMap();
    
              (Line 158) JasperReport jasperReport = JasperCompileManager.compileReport("report1.jrxml" );
              JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, jrRS);
              JasperExportManager.exportReportToPdfFile(jasperPrint, "report1.pdf");
    
              closeDB();
         }
    
         catch(Exception e) { 
              Logger.getLogger(ProgramRaporlama.class.getName()) .log(Level.SEVERE, null, e);
         }
    }

    Exception occurred during event dispatching:
    java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester
    at net.sf.jasperreports.engine.JasperCompileManager.c ompileReport(JasperCompileManager.java:146)
    at programkayit.ProgramRaporlama.runReport(ProgramRap orlama.java:158)
    Last edited by Eranga; 06-21-2010 at 08:40 AM. Reason: code tags added

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  3. #3
    realosso is offline Member
    Join Date
    Jun 2010
    Posts
    5
    Rep Power
    0

    Default

    I did not install tomcat. I did not understand why it should, sorry I'm using for the first time jasperrepots.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    If you don't install then you've to added relevant libraries into your classpath. VM cannot find required libraries on your system, that's what compiler says.

Similar Threads

  1. jasper report ,jasper report jar files and maven dependencies.
    By rajuchacha007 in forum Advanced Java
    Replies: 1
    Last Post: 04-09-2010, 09:15 AM
  2. jasper report
    By vidhyaprabu in forum New To Java
    Replies: 6
    Last Post: 11-12-2009, 04:31 AM
  3. Problem With Dimension of Jasper Report
    By Prashant.surwade in forum Advanced Java
    Replies: 3
    Last Post: 09-19-2009, 03:29 PM
  4. Problem in running jasper report in servlet
    By khadaree in forum Java Servlet
    Replies: 1
    Last Post: 07-16-2009, 10:35 AM
  5. Replies: 0
    Last Post: 03-04-2009, 10:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •