Search code examples
crystal-reportsformat-string

Get string within a specific string


Please excuse the stupid question, but I am an absolute freshman in Crystal Reports.

I would like to add a plaintext to Crystal Reports. The problem is, if a hyperlink has been inserted that contains a display text, it will be displayed as follows:

HYPERLINK "http://google.de/https://www.google.com/webhp?hl=de&sa=X&ved=0ahUKEwipsMvN_-vkAhWCEVAKHf3JBCIQPAgD " google.com

I just want the hyperlink to be displayed within "

The result should be https://www.google.com/webhp?hl=de&sa=X&ved=0ahUKEwipsMvN_-vkAhWCEVAKHf3JBCIQPAgD

However, it is also possible that "hyperlinks" that do not contain a hyperlink may occur.

My professor has created an Access database that contains texts and hyperlinks and I have to display the hyperlinks correctly.

Some lines of the database:

HYPERLINK "http://votetandem.org/" votetandem.org HYPERLINK "https://app.votetandem.org/"votetandem.org

Sometimes there is a space between "URL" display text and sometimes not


Solution

  • I found a solution for my problem. I created a formular field. chr(34) is " in ASCII

    If InStr({TABLE},"HYPERLINK " & chr(34)) > 0 Then

    Split({TABLE},chr(34))[2]

    else {TABLE}

    the URL is the second entry. The first is Hyperlink, second real URL and the third the displayed name.