Binding links to components

You can bind links to labels, images, DBFields, formula fields, parameter fields, multimedia objects, and special fields.

To bind a link to a component:

  1. Right-click the component and select Link on the shortcut menu. The Insert Link dialog appears.
  2. Specify the link type to which the component will be linked by selecting the desired type and then set the related options for the type.
  3. When done, click OK to close this dialog.

See also Insert Link dialog for additional help about options in the dialog.

Once a link is added to an object, you can further edit it or remove it.

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 Studio, it is very simple to set up the link relationship between two reports.

  1. Open the web 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. Usually you can use a label, a field (DBField, summary, formula, parameter, or special field), or an image as a trigger object.
  3. Right-click the trigger object, click Link on the shortcut menu. The Insert Link dialog is displayed and Link to Report is selected by default as the link type. See the dialog.
  4. Click the Browse button beside the Report text field to specify the target web report you want as the linked report.
  5. Specifies the window or frame in which to load the linked report from the Target drop-down list.
  6. Click the Advanced button to displays the advanced settings.
  7. In the Conditions tab, click above the Components box to specify which components in the linked report will be interlinked with the primary report.
  8. Select a component in the Components box, then specify the link relationship for the selected target component in the Field Conditions box as follow:
    1. Click the button above the Field Conditions box, then a new condition row will be added.
    2. Select a field from the drop-down list in the Fields(Primary) column.
    3. Choose an operator from the drop-down list in the OP column. The operator can be "=", "<>", "<", ">", "<=", ">=", or "IN".
    4. Specify the field 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.
    5. If necessary, you can specify more link conditions by clicking the button and then 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.
    6. Repeat the above steps to set link conditions for other target components.
  9. From the Default Linked Component drop-down list, select which component in the linked report will be linked with the primary report by default. Then, when the primary report is opened in HTML, PDF or Excel format, or in JReport Studio, the page where the data that meet the predefined condition in the specified component in the linked report will be displayed by default after you click the link.
  10. If the linked report uses parameters, go to the Parameters tab, the Target Report Parameters box lists the parameters of the linked report. You can assign fields of the primary report to the parameters. Then, when running the linked report from the link, the field values of the primary report will be assigned to the parameters automatically.
  11. Click OK to apply the settings.

Then, when the primary report is run in JReport Studio, or in HTML, PDF or Excel format with Run Linked Report being selected, the link will be enabled, and 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.

If the linked report is opened in the same frame as the primary report in JReport Studio, you can click on the toolbar to go back to the primary report. Click next to and you will get a drop-down list which lists the original report and the linked targets you have just visited within the link chain. The item checked on the drop-down list is the currently opened page. Select an unchecked item and you will be directed to that target.

Notes: