2006 IR Open Dicussion Posted August 27, 2006 Share Posted August 27, 2006 By: tfindlay - exie Error compiling .jrxml file at run time ? 2006-04-27 22:27 Hi, I've started my first JasperReports project, and am using IBM Rational Application Developer (because I'm not a "REAL" programmer). I've got my project working, and added the following JAR's: commons-beanutils-1.5.jar commons-collections-2.1.jar commons-digester-1.7.jar commons-javaflow-20060411.jar commons-logging-1.0.2.jar commons-logging-api-1.0.2.jar itext-1.3.1.jar jasperreports-1.2.2.jar jasperreports-1.2.2-applet.jar jcommon-1.0.0.jar jxl.jar I then created a class with the following code: public void execute(String id) throws Exception { JasperReport jasperReport; JasperPrint jasperPrint; try { JRTextExporter exporter = new JRTextExporter(); jasperReport = JasperCompileManager.compileReport("/projects/rsa_PRJ276/orrExtractWeb/WebContent/reports/vwa_test1.jrxml"); jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap(), new JREmptyDataSource()); } But when it executes, it always crashes when I try to compile the report ... [28/04/06 15:17:20:453 EST] 110e110e SystemErr R net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: C:Program FilesIBMRationalSDP6.0Simple_Report_1146201435765_227164.java:4: package net.sf.jasperreports.engine does not exist import net.sf.jasperreports.engine.*; Using the "J2EE Perspective", I can see the net.sf.jasperreports.engine classes there. It seems lots of other people have posted this question, but I couldnt find any clear answers sorry. Any hints/tips would be great. By: PJ Alarcon - pjalarcon RE: Error compiling .jrxml file at run time ? 2006-04-28 00:23 I encountered the same error before. You need to set the System property jasper.reports.compile.class.path: System.setProperty("jasper.reports.compile.class.path", "full path to jasperreport jar file"); By: Lucian Chirita - lucianc RE: Error compiling .jrxml file at run time ? 2006-04-28 01:38 Hi The simplest way to fix this is to include the jdt-compiler jar (found in the lib directory of the JR distribution) in the classpath. HTH, Lucian By: tfindlay - exie RE: Error compiling .jrxml file at run time ? 2006-04-29 21:43 Thanks! That worked like a charm. I've now made my first jasper report. :) I'm now going to try making a fixed-width flat file with it. Thanks a ton! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now