ComponentOne Reports for WPF
C1.C1Report Namespace / Field Class / LinkTarget Property
Example

In This Topic
    LinkTarget Property (Field)
    In This Topic
    Gets or sets an expression that evaluates to a URL to be visited when the field is clicked.
    Syntax
    'Declaration
     
    Public Property LinkTarget As String
    public string LinkTarget {get; set;}
    Remarks

    If not empty, this should be an expression that evaluates to a URL. After the report is generated, clicking on the field will cause the report viewer to navigate to the URL. The report viewer can be a web browser (for HTML reports), Adobe Acrobat (for PDF reports), or other viewer applications.

    Not all report viewers support hyperlinks. The PrintPreview control that ships with .NET, for example, does not.

    The field will be displayed as usual, based on the contents of its Text and Picture properties.

    The LinkTarget expression is always evaluated, regardless of the setting of the Calculated property (which only applies to the display text). This allows you to bind the LinkTarget to a field in the data source, as show in the example below.

    Example
    The code below creates two hyperlink fields, one with a static value and one based on a database value.
    // set up a static link
    Field f = c1r.Fields["companyInfoLink"];
    f.Calculated = false;
    f.Text = "click here for more info on our company";
    f.LinkTarget = "http://myrealty.com";
                
    // set up a databound link
    Field f = c1r.Fields["propertyInfoLink"];
    f.Calculated = false;
    f.Text = "click here for more info on this property";
    f.LinkTarget = "\"http://myrealty.com/moreinfo?id=\" & propertyID";
    See Also