Skip to main content

Add Cross-References and Hyperlinks

  • 2 minutes to read

This topic describes how to add a navigation link to a report element so that the user can click the element in the Print Preview to navigate to other report elements or external resources.

Add Cross-References

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:

  1. Set the Target property to _self to specify a link in the same document.

    Set the Target Property

  2. Set the NavigateUrl property to the target control’s Name property value.

    Set the NavigateUrl Property for the Cross Reference

The cursor automatically changes to a hand icon in the Report Preview when a user hovers over the control. You can make a control look like a link by setting its appearance properties (for example, change the color of the text to blue and underline it).

Cross Reference Appears as Link

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:

  1. Set the NavigateUrl property to the target URL string or bind it to a data source field that contains a URL.
  2. Set the Target property to _blank or leave it empty.

Set the NavigateUrl Property for the Hyperlink

The cursor automatically changes to a hand icon in the Report Preview when a user hovers over the control. You can make a control look like a link by setting its appearance properties (for example, change the color of the text to blue and underline it).

Hyperlink Appears as Link

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]

Hyperlink NavigateUrl Expression Editor

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.

AllowHTMLMarkup example