Sub Reports

JReport allows a report (referred to as the sub report) to be inserted into another report (refered to as the primary report). There is no difference between the primary report and the sub report. A sub report can be standalone, i.e. it can be run separately like a normal report or it can also include another sub report.

The connection between a primary report and a sub report are links.  A link is the way of creating connections between the primary report and the sub report.

Creating a sub report:

Sub Report Link:

The Sub Report Link is the relationship between the primary report and the sub report.  You can build up one or more links between a primary report and a subreport. When you build a link, JReport will match up the records with equal relationships within the sub report and the primary report.  For example, let's say we have a primary report that is focused for customers and the sub report for orders.  When we build up the link between them, JReport will build a subreport for each customer.  The subreport will then only include those order records for that customer. 

First you must choose a previous report as the sub report.   Next click on the Sub Report Link button.  The following window should pop up.

help132.gif (8405 bytes)