Both reports and dashboards include hyperlinks (URLs) that link to websites or other reports. Visualize.js gives you access to the links so that you can customize them or open them differently. For links generated in the report, you can customize both the appearance and the container where they are displayed.
This chapter contains the following sections:
• | Structure of Hyperlinks |
• | Customizing Links |
• | Drill-Down in Separate Containers |
• | Accessing Data In Links |
Structure of Hyperlinks
The following JSON schema describes all the parameters on links, although not all are present in all cases.
Customizing Links
You can customize the appearance of link elements in a generated report in two ways:
• | The linkOptionsexposes the beforeRender event to which you can add a listener with access to the links in the document as element pairs. |
• | The normal click event lets you add a listener that can access to a link when it's clicked. |
Drill-Down in Separate Containers
By using the method of listing for clicks on hyperlinks, you can write a visualize.js script that sets the destination of drill-down report links to another container. This way, you can create display layouts or overlays for viewing drill-down links embedded in your reports.
Associated HTML:
Associated CSS:
Accessing Data In Links
In this example, we access the hyperlinks through the data.links structure after the report has successfully rendered. From this structure, we can read the tooltips that were set in the JRXML of the report. The script uses the information in the tooltips of all links in the report to create a drop-down selector of city name options.
By using link tooltips, your JRXML can create reports that pass runtime information to the display logic in your JavaScripts.
Associated HTML:
Associated CSS:
Recommended Comments
There are no comments to display.