Jump to content
JasperReports Library 7.0 is now available ×

Error compiling report java source file


2004 IR Help

Recommended Posts

By: Michael Farrugia - mikelupu

Error compiling report java source file

2005-01-05 16:41

Hi,

 

I am trying to compile my first report as a standalone class through Eclipse 3.0 using JDK 1.5 and each time I get the following error message:-

net.sf.jasperreports.engine.JRException: Error compiling report java source file : C:projectsupupaFirst.java

 

The main method contains the following code:-

 

JasperDesign jd = JRXmlLoader.load("first.xml");

JasperReport jr = JasperCompileManager.compileReport(jd);

.... Error triggered here .....

Map parameters = new HashMap();

 

The xml file definition I'm using is an empty definition:-

 

<?xml version="1.0" encoding="UTF-8"?>

 

<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

 

<jasperReport name="First" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30">

<detail>

</detail>

</jasperReport>

 

However I also tried to compile the sample files that are on the project's website and they still returned the same error.

 

Any help will be highly appreciated.

 

Mike

 

 

 

 

By: BJ Freeman - bjfreeman

RE: Error compiling report java source file

2005-01-06 05:54

first try JDK 1.4+

though I am not using the same as you here is mine that works

<taskdef name="jasperreportcompile" classname="net.sf.jasperreports.ant.JRAntCompileTask">

<classpath>

<fileset dir="${lib.dir}" includes ="jasperreports0.6.0_fat.jar"/>

<!--pathelement location="${jasper.root.dir}/lib/jasperreports-0.5.0.jar"/-->

</classpath>

</taskdef>

 

 

<target name="jasperreport" depends="init">

<jasperreportcompile destdir="${build.dir}/classes/jasperreports">

<classpath>

<fileset dir="${lib.dir}" includes ="jasperreports0.6.0_fat.jar"/>

<fileset dir="${build.dir}/classes/jasper" includes ="invoice.xml"/>

</classpath>

<src path="${build.dir}/classes/jasper"/>

<exclude name="${build.dir}/classes/jasper/*.*.bak"/>

</jasperreportcompile>

 

</target>

 

 

 

 

 

By: Michael Farrugia - mikelupu

RE: Error compiling report java source file

2005-01-07 14:56

Thanks BJ for your help I managed to successfully compile the reports using the ant task still using JDK 1.5.

 

I was then able to view my report through a simple method calling the fillReport and viewReport.

 

JasperPrint jasperPrint = JasperFillManager.fillReport("./first.jasper", parameters, c);

JasperViewer.viewReport(jasperPrint);

 

Regards,

Mike

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...