Jump to content

XML Datasource IReport 2.0.5 'The document has ..'


S4_mario

Recommended Posts

I am using iReport 2.0.5.

 

I am using a XML File as datasource. I grep my datas via xpath and I am able to drag and drop my fields in the Reportarea.

 

Once I compile and start the Report in the editor I always get the message "The document has no pages."

 

I followed a lot of tuturials, but I can not convince "iRepod" to do what I want, and it`s not made by Apple :-).

 

Cheers for ur help

 

Mario

Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

Your documents may not have a query, click top of you data and check report query if there is a query.I had that error before and I realize just drag and droping is not the only way you need a query to select from.
Link to comment
Share on other sites

Hi systemp,

 

I put in an xpath expression into the query field. Without any changes. I still don`t get any datas.

 

XPATH Expression:

/addressbook/category/@name

 

XML Datasource:

<addressbook>

<category name="home">

.....

</category>

<category name="work">

......

</category>

</addressbook>

 

So this should give me at least 2 datasets. "home" and "work". But nothing happens.

 

Thx

Link to comment
Share on other sites

  • 2 weeks later...

Hi systemp, hi Mahesh,

 

I followed the tutorials. (My given example is the tutorial one) If you have a better tutorial, let me know and please post the answer here. I think everyone should know the solution....if there is one... :huh:

 

thx

 

Mario

Link to comment
Share on other sites

  • 4 weeks later...

Hi, helping another guy that faced the very same problem but using DynamicJasper on top of JasperReports, I noticed that with XML datasources, embedded queries does not work (it does with SQL). I dunno if this is a bug, but I could not make it work like that.

 

To make it work, the query must be passed as parameter to the constructor of the datasource object.

 

Code:
JRXmlDataSource ds = new JRXmlDataSource(document, "/my/xpath/query"«»);

 

Since you are using iReport, you'll need extra code to pass a JRDataSource object at fill time since embedded queries for xml seems to be failing

Link to comment
Share on other sites

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