Search code examples
jasper-reports

jasper studio 6.3.0 hyperlinks


Can a report contain hyperlinks that point to a URL or an external software so that when those hyperlinks are clicked, the user will be taken directly to that software or URL which allows the user to view/edit the report directly?

P.S. I am using Jaspersoft Studio 6.3.0


Solution

  • Yes.

    1. Place a Text Field on the report.
    2. Select the text field.
    3. Set Expression the text that the user reads for the hyperlink (e.g., anything but "Click Here!")
    4. Click the Hyperlink button on the Properties panel (depending on the screen resolution of your monitor, you might have to expand the panel to see the button).
    5. Expand [+] Hyperlink.
    6. Set Link Target to: Self
    7. Set Link Type to: Reference
    8. Set Hyperlink Reference Expression to a string with a fully qualified HTTP GET request URL (e.g., "http://company.com/reports?id=12345").
    9. Run the report.

    For PDF and HTML versions (and possibly Excel?) the report will contain a clickable hyperlink.

    From there, that fully qualified HTTP GET URL can point to a web application that provides a download link for that report (e.g., by reading the id=12345 value given by the hyperlink).