Add Cross-References and Hyperlinks
- 2 minutes to read
This document describes how to make an element navigate to other elements in a report or external resources by clicking it in a Print Preview.
You can improve report navigation using a cross-reference because the link’s target is in the same document.
You can add a cross-reference for a report control by setting the following properties:
Set the XRControl.Target property to _self to specify that the link is in the same document.
In this case, the control behaves like a link meaning that the cursor automatically changes to a hand in a report’s preview when hovering the control. You can make a control resemble a link by specifying its appearance properties (for example, change the text’s color to blue and underline it).
The link uses the first occurrence if there are multiple instances of an object marked as a link’s target.
A report’s cross-references are preserved when exporting it to PDF.
A hyperlink means that a link’s target is outside the report.
You can set the following options to display a hyperlink in a report:
- Set the XRControl.NavigateUrl property to the target document’s URL.
Remember to use the “http://“ or “https://“ prefix when specifying the URL.
You can make a control resemble a link by specifying its appearance properties (for instance, set the underlined text and blue color).
The cursor automatically changes to a hand when hovering the control in a report’s preview.
Use the link’s XRControl.Target property to specify where to open the target document (in the same preview window, in a new blank window, etc.).
- Enable the XRLabel.AllowMarkupText option and use an “href” markup tag to format the XRLabel.Text property value.
value string specifies a hyperlink source, and the
title string between the opening and closing tags is the text to be displayed.
Welcome to <href="https://www.devexpress.com/">DevExpress</href>!