crystal-reportsvisual-studio-2005c#-2.0crystal-reports-2005

Passing clicked hyperlink text in query string


I am using Visual Studio 2005 Professional Edition.

I have a Crystal Report on which one column contains hyperlink values coming from a stored procedure. When the user clicks on any of these hyperlink values, a next page [here, ReportAllBlocks.aspx] should open but I want to pass this value as a query string.

For example: The user clicked on a hyperlink text: New York, so the URL should become:

http://localhost:1031/myProject/ReportAllBlocks.aspx?New York

I am not following how to add this hyperlink value to the URL, either in the box shown below, or programatically through C#.

enter image description here


Solution

  • I would just create a formula field. First create a parameter for the url(or hard code the value if it never changes).
    In the formula editor:

    {?URLParameter} + {Table.Field}
    

    Then add the formula to your report, open the format editor, and select 'Current Website Field Value' instead of 'A File'. The field will now become a hyperlink. It will still look like text just act different when clicked so you may want to change the font color and underline. Hope this helps.