xtrareports-5173-feature-guide-to-devexpress-reports-add-navigation-add-cross-references-and-hyperlinks.md
This topic describes how to add a navigation link to a report control. It allows users to click the control in Print Preview and navigate to other report controls or external resources.
A cross-reference allows you to navigate to an element in the same document.
Do the following to add a cross-reference to a report control:
Set the Target property to _self to specify a link in the same document.
Set the NavigateUrl property to the target control’s Name property value.
The cursor changes to a hand icon in the Report Preview when you hover over the control. You can change the control’s appearance properties to make it look like a link. For example, set the text color to blue and underline it.
Tip
Report cross-references are preserved when exporting to PDF.
A hyperlink is a navigation link whose target is outside the report.
Do the following to add a hyperlink to a report control:
_blank or leave it empty.The cursor changes to a hand icon in the Report Preview when you hover over the control. You can change the control’s appearance properties to make it look like a link. For example, set the text color to blue and underline it.
Tip
Hyperlinks are preserved when a report is exported to PDF, HTML, MHT, RTF, and Excel formats.
You can bind an expression to the NavigateUrl property so that the target hyperlink value depends on the current data field value:
'https://localhost:54114/category?' + 'id=' + [CategoryID]
You can show a hyperlink in the text that the XRLabel control displays. For this, enable the AllowMarkupText option and use the href tag in the string assigned to the Text property value.
Syntax:
<href=value>title</href>
The value string specifies the target URL, and the title string is the displayed text.
DevExpress Reports automatically validates all URLs to protect against security threats such as XSS, SSRF, and phishing attacks.
Only the following URI schemes are allowed:
httphttpsmailtoUnsafe schemes such as javascript:, file:, data:, and others are blocked and rendered as plain text.
For additional information on URL validation rules and how to customize validation logic, refer to the following topic: Safe URL Validation.