Adding Links in a Report
A web report can be linked with other reports, locations specified by URLs, e-mail addresses or Blob data type fields, so that the report users can gain access to the linked targets by selecting the corresponding trigger objects in the report.
In a web report, the following objects can be used as the trigger objects of links: labels, images, DBFields, formula fields, parameter fields, special fields, and the category (X) axis labels, legend labels and data markers of charts. You can create either simple links or conditional links in a report. With conditional link, different targets can be loaded based on different conditions.
Below is a list of the sections covered in this topic:
Adding a Link
To add a simple link in a report:
- Right-click the object used as the trigger object of the link and select Link on the shortcut menu to display the Insert Link dialog.
- From the Link Type drop-down list, select the target to which the object will be linked: Report, URL, E-mail or Content.
- Specify the options for the link target.
- Select OK to create the link.
To add a conditional link to an object:
- Right-click the object used as the trigger object of the link and select Link from the shortcut menu to display the Insert Link dialog.
- Check the Conditional Link checkbox.
- Select the button to open the Edit Conditions dialog to define a condition using either simple expressions or complex expressions according to your requirements.
The newly added condition will then be displayed and highlighted in the conditions box in the Insert Link dialog.
- From the Link Type drop-down list, select the target to which the object will be linked under this condition: Report, URL, E-mail or Content, then specify the options for the link target.
- Repeat the above steps to add more conditions and define the link target for each condition.
To edit a condition, select the condition in the Condition box, then select . In the Edit Conditions dialog, edit the expressions as required.
To remove a condition and the corresponding format, select the condition in the Condition box and select .
To adjust the priority of a condition, select the condition in the Condition box and then select or .
- Select OK to finish defining the conditional link.
For an illustrated example, see Example of binding a conditional link.
Linking to Another Report
You can make a report linked to another report, then when you select the trigger object in the primary report, you will be able to jump to the linked report to obtain information about the trigger object.
- In the Insert Link dialog, select Report as the link type.
- Select the Browse button beside the Report text box to specify the target web report you want as the linked report in the Select a Report dialog.
- Specifies the window or frame in which to load the linked report from the Target drop-down list.
- Select the More button to display more options for setting the link.
- In the Filter tab, select above the Components box to specify which components in the linked report will be interlinked with the primary report.
- Specify the conditions based on which the link relationship between the primary report and the selected components in the linked report is set up.
- Select a component in the Components box.
- Select the button above the Field Conditions box and a condition line is added.
- Select a field from the drop-down list in the Fields(Primary) column.
- Choose an operator from the drop-down list in the OP column. The operator can be "=", "<>", "<", ">", "<=", ">=", or "IN".
- 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.
- If necessary, you can specify more conditions by selecting the button and then specifying the primary report field, the operator, and the corresponding field in the linked report. Note that the relationship between these conditions is AND, which means that Logi JReport will fetch linked report data which meets all of the conditions.
- Repeat the above steps to set link conditions between the primary report and other components in the linked report.
- Specify whether to apply the on-screen filters in the primary report to the selected components in the linked report.
- Select the component to which you want to apply the filters from the Components box.
- Check Pass on-screen filters to the linked components.
- If the trigger component in the primary report and the selected component in the linked report use different business views, you need to select Mapping Table to define the mapping relationship based on which the on-screen filters in the primary report are passed to the linked report in the Mapping Table dialog.
- Select above to add a mapping line.
- Select the field that is bound with an on-screen filter in the primary report from the drop-down list in the Fields (Primary) column.
- All available fields in the linked report of the same value type as the selected on-screen filter field are listed in the drop-down list in the Fields (Linked) column. Select a field whose values are the same as those of the on-screen filter field.
A mapping relationship is now set up. Then when the link is triggered, the corresponding on-screen filter in the primary report will be applied on the selected linked report field.
- Add more mapping lines and define the mapping relationship between the on-screen filter fields in the primary report with appropriate fields in the linked report.
- Select OK to go back to the Insert Link dialog.
- Repeat the above steps to apply the on-screen filters in the primary report to other components in the linked report.
- From the Default Linked Component drop-down list, select the component that is displayed by default in the linked report when the link is triggered in exported result.
For example, a linked report contains a chart and a table and the table is specified as the default linked component. When you export the primary report to PDF with linked report and trigger the link in the PDF result file, the page that contains the table will be displayed by default. You can scroll to view the chart.
- If the linked report contains one or more parameters, the Parameters tab is activated. In this tab, you can assign fields of the primary report to parameters of the linked report to use the field values for the parameters automatically when running the linked report from the link. If the selected field is a parameter field, you can choose Current Value to use its most recently specified value or Initial Value to use its original value for the parameter in the linked report.
- If you would like the values of the filter objects like filter controls in the primary report to be passed to filter objects in the linked report, go to the Advanced tab to set up the relationship between the filter objects as follows.
- Select to add a line.
- In the Primary Report Property/Object column, select to select a filter object in the primary report in the Select Value dialog and select OK.
- In the Linked Report Property/Object column, select to select a filter object in the linked report in the Select Value dialog and select OK. You need to make sure that values of the filter object in the primary report can be applied to the filter object in the linked report in the same line.
- Follow the above steps to set up the relationship between more filter objects.
- Select OK to apply the settings.
You can then trigger the link to open the linked report which will be displayed according to the specified link conditions. The link is also available when the primary report is opened in HTML, PDF or Excel format with the option Run Linked Report being selected.
If the linked report is opened in the same frame as the primary report in Web Report Studio, you can select on the toolbar to go back to the primary report. Select 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:
- When linking reports, you need to avoid link loops. For example, if you have linked report A to report B, then you cannot link report B back to report A again.
- The conditions specified in the Filter tab are used for filtering when the link is triggered at server runtime, that is, only the data that meet the conditions in the linked report will be displayed. However, when the link is triggered in HTML, PDF or Excel result, the conditions are used for setting up search criteria between the two linked reports, which means after you select the trigger object in the primary report, the pages containing the data that meet the conditions in the linked report will be displayed.
Linking to a URL
- In the Insert Link dialog, select URL as the link type.
- Enter the URL in the Hyperlink text box directly. If needed, select the Add Dynamic Field button to insert a field into the URL to compose a dynamic URL.
For example, suppose the link is defined on the Country DBfield and you compose the URL as follows: type in http://www.google.com/search?q= into the Hyperlink text box, then select the Add Dynamic Field button to insert the field Country at the end of the URL. You can then select any country value to open a specific URL that directs to a specific country.
- Specify the frame from the Target drop-down list.
The Target property works when the link is triggered in Web Report Studio. When the link is triggered in JDashboard, except for Same Frame, all the other targets are treated as New Window.
- Select OK to set up the link.
You can then trigger the link to open the URL. The link is also available when the report is opened in HTML, PDF, or Excel format.
Linking to an E-Mail
- In the Insert Link dialog, select E-mail as the link type.
- Enter the e-mail address in the Hyperlink text box directly. If needed, select the Add Dynamic Field button to insert a field into the e-mail address to compose a dynamic e-mail address.
- Select OK to set up the link.
You can then trigger the link to open the e-mail with the information specified in the Hyperlink box. You can further customize the e-mail and send it. The link is also available when the report is opened in HTML, PDF, or Excel format.
When composing the e-mail address, you need to follow the syntax: sAddress[sHeaders]
. Below are details about the syntax.
- sAddress
One or more valid e-mail addresses separated by a semicolon. You must use Internet-safe characters, such as %20 for the space character. - sHeaders
Optional. One or more name-value pairs. The first pair should be prefixed by a "?" and any additional pairs should be prefixed by a "&". The name can be one of the following strings:- CC
Addresses to be included in the "cc" (carbon copy) section of the message. - BCC
Addresses to be included in the "bcc" (blind carbon copy) section of the message. - subject
Text to appear in the subject line of the message. - body
Text to appear in the body of the message.
- CC
Here are some examples:
user@example.com
user1@example.com;user2@example.com
${Customer Name}@jinfonet.com
, here ${Customer Name} is a field name. Note that, fields can work in the hyperlink only when they are inserted via the Add Dynamic Field option.salesmanager@${Country}.jinfonet.com
, here ${Country} is a field name.user@example.com?CC=user1@example.com&BCC=user2@example.com&subject=TestLinkToEmail&Body=Version%20x.x%0D%0A%0D%0ATest%20Link%20To%20E-mail
Here is the e-mail result:
Linking to a Blob Data Type Field
When a report is linked with Blob data type fields, the Blob data type fields will be bound to the trigger objects of the links and displayed as hyperlinks, and you can download the Blob content by selecting the hyperlinks in the report.
In Logi JReport, Blob could be image, Binary, Blob, Clob, LongBlob, LongClob, Varbinary, Longvarbinary, and so on.
To make a report linked to a Blob data type field:
- In the Insert Link dialog, select Content as the link type.
- From the Query drop-down list, select the business view which contains the required Blob data type field. Only business views that come from the same data source connection as the business view the current report uses are available in the drop-down list.
- From the Content Type drop-down list, specify the content type for the Blob type data. You can select the button to bind it with a string type business view element or a record level pass one formula in the selected business view, or with a dynamic formula in the current report.
- In the File Name text box, specify a file name for the linked Blob type data. You can select the button to specify a string type business view element or a record level pass one formula in the selected business view to control the file name.
- From the Content drop-down list, choose a Blob data type field in the selected business view.
- Select the More button to display more link options.
- In the Filter tab, specify the filter conditions between the business view used by the current report and the business view that contains the linked Blob content as follows:
- Select above the Field Conditions box and a condition line is added.
- Select the desired field of the business view used by the current report from the Fields(Primary) drop-down list.
- Choose an operator from the drop-down list in the OP column.
- Specify the field/formula of the business view that contains the linked Blob content from the drop-down list in the Fields (Linked) column. All fields that are of the same data type as the selected field in the Fields(Primary) column are available in the drop-down list.
- If necessary, you can specify more conditions by selecting the button and then specifying the fields and operators accordingly. Note that the relationship between these link conditions is AND, which means that Logi JReport will fetch the linked Blob type data which meets all of the conditions.
- If the business view that contains the linked Blob content uses parameters, the Parameters tab will be enabled. In this tab, you can assign fields of the business view used by the current report to the parameters. Then, when accessing the Blob type data from the link, the field values will be assigned to the parameters automatically.
- Select OK to apply the settings.
You can then trigger the link to download the Blob content according to the specified conditions. The link is also available when the report is opened in HTML, PDF, or Excel format.
Opening a Link
To open a link, switch Web Report Studio to View Mode, then right-click the trigger object and select Show Linked Target from the shortcut menu.
If the web report is created in Web Report Studio, you can also directly select the trigger object to open the link, while for a web report created in Logi JReport Designer, whether you can do this depends on the report's Select Priority property setting at report design time. If the priority of the go-down action is specified the highest and the trigger object is in a hierarchy, you can use a select on the object to open the link only after you have gone down to the lowest level of the hierarchy.
Editing a Link
To edit a link, right-click its trigger object and select Edit Link from the shortcut menu. In the Edit Link dialog, edit the link according to your requirement.
Removing a Link
To remove a link, right-click its trigger object and select Remove Link on the shortcut menu. In the warning message dialog, select Yes to confirm the removal.
Example of Adding a Conditional Link
The following provides an example to show the usage of conditional link and dynamic field.
- In Web Report Studio create a summary table which is based on WorldWideSalesBV in Data Source 1, shows Product Name, Total Sales and Total Cost, and use Basic as the report style.
- Right-click on any Product Name value and select Link from the shortcut menu.
- In the Insert Link dialog, check the Conditional Link checkbox.
- Select to define a condition in the Edit Conditions dialog as follows.
We will make the field linked to a URL target based on the condition.
- From the Link Type drop-down list in the Insert Link dialog, select URL. In the Confirm dialog, select OK.
- In the Hyperlink text box, type in http://www.google.com/search?q= and then select the Add Dynamic Field button to insert the field Product Name at the end of the URL.
For the product names other than Blue Mountain and Breakfast Blend, we will make them linked to an e-mail target.
- Check the Others checkbox. A condition named Others is created.
- From the Link Type drop-down list, select E-mail. In the Confirm dialog, select OK.
- In the Hyperlink text box, type in @example.com and then select the Add Dynamic Field button to insert the field Product Name right ahead of @.
- Select OK in the Insert Link dialog to finish defining the links.
Next we can select the product names in the table to view the link result.
- Switch Web Report Studio to View Mode.
- Select Blue Mountain. A Google search result page with the keyword Blue Mountain is then displayed.
- Select Breakfast Blend and a Google search result page with the keyword Breakfast Blend is displayed.
- Select Sumatra and an e-mail is displayed as follows: