Using Hyperlinks in Articles
Most report objects in Articles include a Hyperlink property. This property defines what happens when a user clicks the object in the Preview window. Hyperlinks allow you to add interactive behavior to your reports, similar to links on a web page.
Hyperlinks can be used to open web pages, send email, run commands, navigate to other pages, or trigger custom logic.
Hyperlink Actions
Articles supports several hyperlink types. Each type is selected using the Hyperlink.Kind property, and additional fields such as Value, DetailPage, or DetailReport depending on the action.
Below are the supported hyperlink behaviors.
Internet URL
This option opens a web page in the userโs default browser.
How to configure:
- Kind:
hkURL - Value: full URL (including
http://orhttps://)
Example:
Kind = hkURL
Value = https://dscorp.com
Result:
Clicking the object opens the website in the browser.
Email Link (mailto:)
This option opens the default email client with a preโfilled address.
How to configure:
- Kind:
hkURL - Value:
mailto:followed by the email address
Example:
Kind = hkURL
Value = mailto:support@example.com
You can also include a subject line:
mailto:support@example.com?subject=Report Inquiry
Result:
Clicking the object opens a new email message.
Navigate to a Specific Page
This option jumps to a specific page in the report preview.
How to configure:
- Kind:
hkPageNumber - DetailPage: page number (1โbased)
Example:
Kind = hkPageNumber
DetailPage = 3
Result:
Clicking the object jumps to page 3 of the report.
Run a Detailed Report
This option opens another report (a โdetail reportโ) in a separate preview window.
How to configure:
- Kind:
hkDetailReport - DetailReport: name of the detail report (make sure you include the full file path)
Example:
Kind = hkDetailReport
DetailReport = c:\reports\SalesDetail.fr3
Result:
Clicking the object opens the SalesDetail report.
Custom Script Action
This option triggers a custom action defined in the report script.
How to configure:
- Kind:
hkCustom - Value: any string you want to use as an identifier
Example:
Kind = hkCustom
Value = ShowCustomerInfo
Then handle it in script:
procedure ReportOnClickObject(View: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean);
begin
if View.Hyperlink.Value = 'ShowCustomerInfo' then
ShowMessage('Customer information goes here.');
end;
Result:
Clicking the object runs your custom script logic.
Complete Example
Below is a simple example showing three different hyperlink types in one report.
1. Open a website
Hyperlink.Kind = hkURL
Hyperlink.Value = https://www.example.com
2. Send an email
Hyperlink.Kind = hkURL
Hyperlink.Value = mailto:info@example.com?subject=Hello
3. Jump to page 2
Hyperlink.Kind = hkPageNumber
Hyperlink.DetailPage = 2
When previewed:
- Clicking the first memo opens a website
- Clicking the second opens a new email
- Clicking the third jumps to page 2