Jump to content

Help with net.sf.jasperreports.engine.JasperCompil


hakhaimo

Recommended Posts

Hi!

I am new to jasper reports. Before introducing my problem. I have to tell first what is my current setup.

I am currently using Netbeans 6.5. I am using jasperreport-3.7.0.jar which was added as a library in my project's library folder. I imported the jasperreport-3.7.0.jar library through importing it in netbeans. I have my report defnition .jrxls file created from iReport. I have an iReport plugin in my Netbeans IDE. I put the .jrxls definition file at the "C:\" Directory.

this is my code in from my application:

found in section A of the code part.

and I got this error:
 

found in section B of the code part.

 I tried all solutions I can find from Google. Nothing works.

And can I also ask if how will I be able to put the .jrxls definition and use them while they are in my project folder, which is later on build as one .jar file for distribution/deployment.

Thanks!!

Code:
// SECTION A: ------------------------------------------------public void printPreview2(){               try {            String source = "C:/PrintReportSummaryFromStudents.jrxml";            if (new File(source).exists() == false) {                System.out.println("Error!");                return;            }            JasperReport jasperReport = JasperCompileManager.compileReport(source);                       JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, null, new JRTableModelDataSource(jTable1.getModel()));            JasperViewer.viewReport(jasperPrint, false);        } catch (Exception e) {            e.printStackTrace();            System.out.println("reports Error  " + e.toString());        }    }//SECTION B: ------------------------------------------------Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester        at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:146)        at fpms.ReportSummary.GUIViewActualReportSummary.printPreview2(GUIViewActualReportSummary.java:60)        at fpms.ReportSummary.GUIViewActualReportSummary.jButton1ActionPerformed(GUIViewActualReportSummary.java:559)        at fpms.ReportSummary.GUIViewActualReportSummary.access$200(GUIViewActualReportSummary.java:33)        at fpms.ReportSummary.GUIViewActualReportSummary$3.actionPerformed(GUIViewActualReportSummary.java:448)        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)        at java.awt.Component.processMouseEvent(Component.java:6038)        at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)        at java.awt.Component.processEvent(Component.java:5803)        at java.awt.Container.processEvent(Container.java:2058)        at java.awt.Component.dispatchEventImpl(Component.java:4410)        at java.awt.Container.dispatchEventImpl(Container.java:2116)        at java.awt.Component.dispatchEvent(Component.java:4240)        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)        at java.awt.Container.dispatchEventImpl(Container.java:2102)        at java.awt.Window.dispatchEventImpl(Window.java:2429)        at java.awt.Component.dispatchEvent(Component.java:4240)        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)BUILD STOPPED (total time: 21 seconds)
Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...