Jump to content
JasperReports Library 7.0 is now available ×

Need HELP with XMLDatatsource


2004 IR Help

Recommended Posts

By: chiphi13 - chiphi13

Need HELP with XMLDatatsource

2004-12-15 09:06

I am very new to using jasperreport and ireports. I am try to create a report using an xml document as the datasource:

<?xml version="1.0" encoding="ISO-8859-1"?>

<catalog>

<cd country="USA">

<title>Empire Burlesque</title>

<artist>Bob Dylan</artist>

<price>10.90</price>

</cd>

<cd country="UK">

<title>Hide your heart</title>

<artist>Bonnie Tyler</artist>

<price>9.90</price>

</cd>

<cd country="USA">

<title>Greatest Hits</title>

<artist>Dolly Parton</artist>

<price>9.90</price>

</cd>

</catalog>

 

I have set up the datasource with the following expression:

/database/document

when i try clicking on the test button nothing happens.

 

I have then created a new report and added a field

with the following field description:

/catalog/cd/price

 

When I try executing the report, I receive the following error not matter what i try:

 

Compiling to file... .test.jasper -> .Test.java Errors compiling .test.jasper! net.sf.jasperreports.engine.JRException:?Report?design?not?valid?:? ?????1.?Field?not?found?:?Field ????at?net.sf.jasperreports.engine.design.JRAbstractJavaCompiler.compileReport(JRAbstractJavaCompiler.java:111) ????at?net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:137) ????at?net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:142) ????at?net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:130) ????at?it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:336) ????at?java.lang.Thread.run(Unknown?Source)

 

I REALLY APPRECIATE ANY AND ALL HELP!!!!!!!! What am I doing wrong? Does anyone have steps for setting this up properly?

 

 

 

 

 

By: Wal Millard - walmillard

RE: Need HELP with XMLDatatsource

2004-12-15 19:42

 

You have a Field Object on your report with

 

$F{Field} in the expression.

 

You need to set "Field" to the name of your field. ie in this case something like

 

price

 

I suggest you search the help forum for

 

XMLDatasource

 

and you will find some stuff to read.

 

then you will be very embarrassed about this post.

 

walmillard

 

 

 

 

 

 

By: chiphi13 - chiphi13

RE: Need HELP with XMLDatatsource

2004-12-16 07:04

I actually found the problem before your post, but thanks for the input and vote of encouragement. The problem was there was a field attribute that was added to the report that wasn't visible on the gui, but when i looked at the outline it was there. Once I removed that, low and behold it worked!!

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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