Skip to main content

Geocortex Report Designer Hyperlinking Text DataField with Hyperlink Field

Comments

1 comment

  • Chris Bates
    I found a solution to my problem. 

     

    1. Add another label control to the sub-report containing the hyperlink label control

     

    2. Set the Datafield property of the new label to the field in the data you want to use (eg [NAMEFIELD]).

     

    3. Add the following code to the Script tab:

     

     

    public void Detail1_Format()

     

    {

     

        try {

     

               Label lbl = (Label)rpt.Sections["Detail1"].Controls["Link"];

     

               Label lbl1 = (Label)rpt.Sections["Detail1"].Controls["LinkLabel"];

     

               

     

               string linkUrl = rpt.Fields["HYPERLINK"].Value.ToString();

     

               string linkLabel = rpt.Fields["NAMEFIELD"].Value.ToString();

     

               

     

               lbl.HyperLink = linkUrl;

     

               lbl.Text = linkLabel;

     

           }

     

           catch (Exception e) {

     

           

     

           }

     

    }

     

     

    4. In the properties for the new control created in Steps1-2 Set the Visibility = False
    0

Please sign in to leave a comment.