Hyperlink in each record on my report such that the link points to a document that is specific to the report record

Posted on 2011-05-09
Last Modified: 2012-05-11
I would like to provide a hyperlink in each record on my report such that the link points to a document that is specific to the report record. All of target documents will be stored in the same directory. Each document is identified by a unique number, and I am already capturing those numbers in the report. There IS one other part of the path that I am not currently capturing, but I COULD capture it (if needed).

The basic path would look like:
"server\directory\*_{ID-Number-from-CR-Field}.pdf" or like:

In the first example, the * represents the part of the file name that would vary and the {number} is the unique number that is already captured for each record. I COULD add a field to the report to capture the "*" information, if it cannot be handled as a wild card.

The problem is that I have tried several combinations of syntax, and none seem to work. Thank you!
Question by:jnrmiller
    LVL 100

    Accepted Solution

    I think you will need to capture the part you aren't.

    Before working on that, choose a value that would be captured and try using

    Try something like this.  Replace the * with an appropriate value

    "server\directory\*_" & {ID-Number-from-CR-Field}& ".pdf"

    LVL 3

    Expert Comment

    If it is not a web domain you need to either use the ip address for the server or add the server to the localhosts file of the client computer.

    Have you tried navigating to the server location you are specifying on the client where you are running the report? If running in a browser in BOXI have you tried navigating to it on the server? Also, have you tried putting the same formula on the report as a string just to see if it is generating the values you think it is?

    It would also help to know what you mean by "doesn't work". What error are you getting, or what event is occurring, when you click on the hyperlink?

    Finally, did you try putting "\\" before the server name?

    Author Comment

    I am using the Crystal Reports Formula Workshop feature. The problem is NOT with the basic format of the hyperlink. When I put the following in as the formula, I am able to access the document named in this link: "\\server\directory\form-name_12843.pdf".

    The problem that I would like to use a Crystal Reports field as a variable in the formula. Each record has a unique document associated with it. The number (in this case 12843) is the identifier. I am capturing that unique number in each record (in a CR report field named: {submission_number}.

    I could also capture the form-name, if using a wild card (like *) is not possible. For the sake of this inquiry, let's say that info will be captured in the report as {form_name}.

    Ideally, I would like to be able to use something like the following so that each link would point to the unique document for each record: "\\server\directory\{form_name}_{submission_number}.pdf"

    Since I am not yet capturing the form name, I have set up a test file that matches one of my records. I am providing the form name in the hyperlink and only trying to get it to reference the submission number. I have tried the following, which WILL save, but does not convert to an acceptable hyperlink:

    "\\server\directory\'theformname_' + {submission_number} = '.pdf'"

    I get the message: Unable to open hyperlink: \\server\directory\'theformname_' + {submission_number} = '.pdf'

    Author Closing Comment

    When I first looked at this answer, I didn't recognize that it really WAS the solution. Then, when I looked at it the second time, I noticed the & signs and tick marks. When I tested with a static value in place of the *, I knew this was on the right track. It took a few more minutes and some experimenting to figure out how to add the second variable. I will post the complete solution in a new comment.

    Author Comment

    The exact syntax of the final answer is shown below. The only thing I changed was the text for the server and the directory:

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    This video discusses moving either the default database or any database to a new volume.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now