
User defined drilling
Besides automatic drilling, JReport provides you with custom drilling functions including support for linking to another report and for linking to a detail report, making the analysis of a report more diverse and useful.
Linking to another report
A link to another report can be bound to a field, a label, an image, or a shape map area in JReport Designer. This is useful for viewing some information related to the current report, especially with viewing a report for comparison.
To use a link in JReport Viewer:
- Develop a page report in which a report tab contains an object which is linked to another report in JReport Designer.
- Publish the report to JReport Server.
- Run the report in DHTML format with JReport Viewer.
- Click the trigger object in the report, or right-click the object and then select Link Report from the shortcut menu.
- The linked report will then be shown.
Linking to a detail report
In most cases, your reports will be related to each other, instead of being isolated. Each report may have a particular emphasis on one or more aspects. In some circumstances, you may want to set up certain relationships among your reports so that you can browse from one report to another through the relationship "channels" that you create.
Such an inter-report relationship network can be achieved by setting up "Anchor" and "Filter" conditions between two reports. You can use one report to hold comprehensive report data, and another to show detailed information on a specific topic.
JReport reports can be joined together to compose a master/detail report group. Normally, a master report holds more comprehensive data, while detail reports hold related detail information. A detail report can be the master report of another report. In this way, by setting up more and more pairs of master/detail reports, many reports can be joined together, and a report chain is formed.
To use master/detail reports in JReport Viewer:
- Develop the page reports with master/detail relationship in JReport Designer.
- Publish the reports to JReport Server.
- Run the report which contains the master report in DHTML format on JReport Server.
- Click the trigger object in the master report, or right-click the object and then select Detail Report from the shortcut menu.
- You may be prompted to provide encoding and DB security information before the report result is produced. Click OK if you want to run a detail report using the same encoding and DB security settings as that of the master report.
- The detail report will show only the records in conformity to the anchor and filter conditions.
Notes:
- In JReport Designer, you may find that the user defined drilling feature can provide more functions, such as assigning values to parameters of the link report or detail report automatically and passing style information to the link report. For detailed information, see Linking to another report and Linking to a detail report in the JReport Designer User's Guide.
- To make the detail report show only the records related to a trigger field value in the master report, you should specify the Target Frame option as Same Frame when you set up the master/detail relationship in JReport Designer. If you select Server Setting, you should further make sure that the Pop Up New Window for Links option has not been checked in the Profile > Customize Profile > DHTML > Properties > Default tab. Otherwise, the detail report will be opened in a new web browser window with no relationship to the master report.
- A "link path", which tracks the linking (user defined drilling) actions, will be displayed in the Go To drop-down list on the navigation bar after you have drilled to the link report or detail report if it is opened in the current window. Clicking an item in the list will switch to the corresponding report.
