Jump to content
We've recently updated our Privacy Statement, available here ×

A problem with sub data sets and XML


adamb

Recommended Posts

I have an XML datasource to a report that looks like this:

<?xml version="1.0"?><DATA>    <FIRSTNAME>JOHN</FIRSTNAME>    <LASTNAME>SMITH</LASTNAME>    <PHONE>555-555-5555</PHONE>    ...    <ACCOUNTS>        <ACCOUNT>            <NUMBER>5689</NUMBER>            <NAME>Account #1</NAME>            <BALANCE>111.22</BALANCE>            ...        </ACCOUNT>        <ACCOUNT>            <NUMBER>5690</NUMBER>            <NAME>Account #2</NAME>            <BALANCE>57.85</BALANCE>            ...        </ACCOUNT>    </ACCOUNTS></DATA>

The report works great for everything except the account data. Basically, I want a front page that has the non-account data (FIRSTNAME, LASTNAME, PHONE, etc.) and then on the last page I want to list the accounts and their details.

So far I've been designing the report using iReport, and I cannot get that account data to be displayed at all.

Any ideas would be much appreciated.

Thanks!

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

@kingananth007, thanks for the reply, but I don't think I was clear in my first post.

My report is pulling XML data just fine, and using it. However, I only have access to the highest level of data (ie FIRSTNAME, LASTNAME, etc.). My problem is that I need to access both the high level data such as /DATA/FIRSTNAME and be able to iterate through the lower level data (/DATA/ACCOUNTS) in the same report.

I tried to achieve this through a table, but couldn't get that to work. Has anyone had better luck with a table? Does anyone know of a way to do this?

FYI: I've done this by using a sub report, but the problem is that it calls the database twice, which is doubling the report production time, which I really want to avoid.



Post Edited by adamb at 09/27/2010 15:21
Link to comment
Share on other sites

That makes sense to me in theory, but I do not know how to accomplish this in practice. How do I pass some data from a main report to a subreport? If you have an example that would be great.



Post Edited by adamb at 09/29/2010 17:04
Link to comment
Share on other sites

  • 2 weeks later...

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