views:

69

answers:

1

I am trying to do something like this in iReport:

  • Main Report of all schools in a district. Let's say, select * from schools where district_id = $P{dist_id}
    • A list of teachers in each school (eg, select * from teachers where school_id = $P{school_id}, and school_idea is populated by the above.)
      • A table of each student in each teacher's class (same thing, but now I want select * from students where teacher_id = $P{teacher_id}).

My actual problem space is a little more complicated than this, but this is the immediate problem I'm running into.

I can solve this with subreports, but the thing is, I don't want to have to handle a bunch of XML files when I could just be using one. I would far prefer to have a table embedded in a list, embedded in a report.

I can also get all the tables and lists to work correctly one level down from the master.

However, I can't get a table embedded in a list to work the way I want to. I suspect I'm not pointing at the correct subDataset. I can only seem to pick up the parameters from the main report's connecttion, I don't know the syntax, or otherwise don't know how, to get at the list's subDataset for its child table.

So, is this possible in iReport? Or, am I stuck with using subreports for this kind of thing after all?

Thanks guys.

A: 

You could do joins Districts X Schools X Teachers X Students.

Then with one big result set you can go through using grouping to display the data. This would avoid the subreport issues.

working with subreports and subDataset is a bit tricky to help out with without a lot of information. :/

Arthur Thomas