Linking a report to another report

A report can be linked to another report, after which the trigger object in the primary report can be clicked in order to jump to the linked report to obtain information about the trigger object. In JReport Designer, it is very simple to set up the link relationship between two reports.

  1. Open the report set, or create a new report which will be used as the primary report.
  2. In the report, select an object to be the trigger for loading the linked report.
  3. In the Report Inspector, scroll down the Properties panel to find the property Link of the object, then click in the value cell to show the Link Report dialog (or right-click the trigger object, click Detail Report on the shortcut menu, then select A Report from the Link to drop-down list in the dialog). See the dialog.
  4. Click the Browse button to specify the report set that contains the report you want as the linked report. Then, select the report name from the Report drop-down list.
  5. Click beside the Component in Report field to specify which component(s) in the linked report will be interlinked with the primary report.
  6. Specify the link relationship in the Condition tab.
    1. Select a given field/formula from the left box and click to add it to the Field box. It will then be displayed in the Fields(Primary) column.
    2. Choose an operator from the drop-down list in the OP column. The operator can be "=", "<>", "<", ">", "<=", ">=", or "IN".
    3. Specify the field/formula of the linked report from the drop-down list in the Fields(LinkedReport) column. All fields in the linked report of the same value type as the selected primary report field will be available.
    4. If necessary, you can specify other link conditions by specifying the primary report field, the operator, and the corresponding field in the linked report. Note that the relationship among these link conditions is AND, which means that JReport will fetch linked report data which meets all of the conditions.
  7. If the linked report contains one or more parameters, the Parameters tab will be enabled. In this tab, you can assign field(s) of the primary report to parameter(s) of the linked report. When running the linked report from the link, the field value(s) of the primary report will be assigned to the parameter(s) automatically.
  8. Check Pass style group information down to the linked report to transfer style information from the primary report to the linked report, so that the style of the primary report will apply to the linked report.
  9. From the Target Frame drop-down list, select where the linked report will be loaded.
  10. Click OK to apply the settings.

Then, when the primary report is opened in DHTML, HTML, PDF or Excel format, when you click the trigger object in the primary report, you will find that the linked report is displayed according to the specified link conditions. However, when you open the primary report in formats other than DHTML, the Target Frame setting you specified in the Link Report dialog will be ignored.

Note: