How to Add Clickable URLs to FlexReport and Preserve Hyperlinks in PDF Exports
When generating reports using FlexReport, you may need to include interactive web links that allow end users to click and navigate directly to external URLs. Additionally, these links must remain active and functional when exporting the report to PDF format.
Solution
In FlexReport, you can add clickable URLs using either a ParagraphField (which natively supports HTML-style markup and hyperlinks) or a standard report field combined with the Hyperlink property.
Option 1: Using the Hyperlink Property (Standard Field)
-
Add a standard field (e.g.,
TextFieldorField) to your report section. -
Set the
Textproperty to the display text (e.g.,"Visit Website"). -
Set the
Hyperlinkproperty to the destination URL (e.g.,"[https://www.example.com](https://www.example.com)"or an expression returning a URL).
Option 2: Using ParagraphField with HTML Tags
-
Add a
ParagraphFieldto your report section. -
Set the
Textproperty containing an HTML anchor tag:<a href="https://www.example.com">Click Here to Visit Website</a>
When rendered in the FlexViewer or exported using C1FlexReport.RenderToPdf(), the hyperlinks are preserved, allowing users to click and navigate to the external web page directly from the preview or PDF document.