Jump to content
Changes to the Jaspersoft community edition download ×

problem whith XML Datasource and subreports

2006 IR Open Dicussion

Recommended Posts

By: Jeronimo Torres - major505

problem whith XML Datasource and subreports

2006-05-19 07:51



I'm having a problem whith a subreport and xml datasource.


I have the folowing xml:


<?xml version="1.0"?>




















I'm Trying to show the elements d1, d2, d3, d4 in my report (this part works fine!) and the elements of each d5 elements in a subreport.

Now is my doubt is how should i put the description in the object type field that i created to use as datasource of my sub report and how should be my fields in the sub report.


None of my attempts worked so far...








By: Wal Millard - walmillard

RE: problem whith XML Datasource and subrepor

2006-05-22 17:27



These XPath syntax can be a bit tricky at times but ur example here looks quite straight fwd.


put ur sub report in the group/band or main section of the master report. set its connection to us the datasource type and simply set the expression to point to the node you want to loop thru in the subreport...




like this :


((net.sf.jasperreports.engine.data.JRXmlDataSource) $P{REPORT_DATA_SOURCE}).dataSource("/list/elem/d5")


add fields


item1 description item1

item2 description item2


add field objects on the main section or group/band of ur subreport and set them to these fields.





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