adamb Posted September 22, 2010 Share Posted September 22, 2010 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 More sharing options...
kingananth007 Posted September 27, 2010 Share Posted September 27, 2010 Xpath of this value /DATA/ACCOUNTS/ and a detail band in will solve your prob.if nt need to see your template and xml source file Link to comment Share on other sites More sharing options...
adamb Posted September 27, 2010 Author Share Posted September 27, 2010 @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 More sharing options...
kingananth007 Posted September 28, 2010 Share Posted September 28, 2010 Call /DATA/ (u can access both high level & low level) and use a subreport a subdatasource(/DATA/ACCOUNTS) this way u can have single call to DB. Link to comment Share on other sites More sharing options...
adamb Posted September 29, 2010 Author Share Posted September 29, 2010 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 More sharing options...
adamb Posted October 12, 2010 Author Share Posted October 12, 2010 bump Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now