views:

1620

answers:

3

I'm using iReport and I need to create a sub-report usign a XML DataSource. I will have only one XML for the hole report. Something like:

<question>
  <text>What do you think about SO?</text>
  <options>
    <option>Like it</option>
    <option>Really like it</option>
    <option>Love it</option>
  </options>
</question>

The main report will have it's detail linked to the questions, each question will have many options. Each sub-report must be linked to the options for the question... Well master-detail.

All that I could find with some googling was using SQL, I want to use XPATH.

Thanks!

+1  A: 

Take a look at the JRXmlDataSource JavaDoc. There are example that show how it's done.

Peter Severin
A: 

I recently red a book named JasperReport Development cookbook by Bilal Siddiqui. I found this book very interesting in using XML datasource. This book covers use of XML datasource by defining XML schema of a energy metering company.

Check out this free recipe from the book named [Creating a Report from XML Data using XPath][3], which demonstrates the whole process in a step by step manner.

roshani
A: 

I recently red a book named JasperReport Development cookbook by Bilal Siddiqui. I found this book very interesting in using XML datasource. This book covers use of XML datasource by defining XML schema of a energy metering company.

Check out this free recipe from the book named Creating a Report from XML Data using XPath, which demonstrates the whole process in a step by step manner.

roshani