Open PDFs from Crystal Report

I have a Crystal Report and in it a File Path that links all of a patients records to scanned in PDFs. This will be used in a secure environment, so not a risk. What i need to have happen is when I click on the file path in the report, it opens the document. Is this possible, click on a file path and open the PDF associated to that file path address?
LVL 7
Jeff SAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Raghavendra HullurSoftware DeveloperCommented:
Hi,

Can you provide more details like how are you passing the details of the file location? Is it provided via hyperlink or retrieved as part of a database field?
0
Jeff SAuthor Commented:
The SQL underneath provides a file location on the network. I would like to click on the field name and it take me to the document. I do not want to embed it, just take me to the location.
0
Raghavendra HullurSoftware DeveloperCommented:
I don't think you can use file path from database and open the respective file unless we retrieve an embedded file using hyperlink.
If the file content itself is saved into database using say BLOB, we can retrieve that content using an OLE object.

It seems like you are looking to include multiple pdf files of patients, so, even OLE option may not be feasible for you unless you have all the details in a single file.
0
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Jeff SAuthor Commented:
The report lists multiple objects for the respected patient .... I would retrieve just one value at a time and would need it to act almost as a hyperlink to file location. Right now, I copy the address and paste it into a web url and it retrieves the value just fine. I simply need to remove the time consuming part on copying the address and pasting it. Ideally, clicking on the link and having it open the address would be nice
0
James0628Commented:
What's in the field?  Is it just a path to a single file, like "C:\folder\file.pdf" ?  If so, it seems straightforward enough.

 Put that field on the report (or use some other field, or even an image), then go into the field format and:
 Select the Hyperlink tab.
 Select the "A File" Hyperlink type.
 Click the formula (X+2) button beside the file name box and enter the field name.

 That should do it.  Then when you click on that report field, it should open the file in that path using the default program on that system for that file type (eg. Adobe Reader).

 The only "complication" that I've run into in some testing just now is that if you have more than one link on the same page, after you click on one, you may need to click somewhere else in the report before clicking on another link to open a different file (if you don't click somewhere else first, the second file may not open).

 James
0
Raghavendra HullurSoftware DeveloperCommented:
A solution I can think of is to have a database field (may be patient id of the patient or some unique number) and have pdf files with same name in your file location.
So, what we can do is, we can create a dynamic hyperlink to the file location and on click of database field (say patient ID), we can pass that field value as file name and retrieve the file.

For the example of the hyperlink content, you can check the attached .rpt file by navigating in the path -> format field -->Hyperlink tab and click on X+2 against File Name.

Hope this is a feasible one for you.
Hyperlink.rpt
0
Jeff SAuthor Commented:
Gentleman,

I have tried this and it does not seem to work for me. I have a field name labeled "File Path". It is exactly as you both describe - a file path to the scanned image(s). I right clicked on the field name and went to the Hyperlink tab. I choose "A File" and under the Hyperlink Information tab I selected the X-2 and picked the field. I have attached the report file if you can look to see where I am messing this up. Scanned-EMR-Documents.rpt
0
James0628Commented:
Don't put the field name in quotes.  You used "{Data.FilePath}" as the formula, which just gives you that literal string.  Try {Data.FilePath} (no quotes).

 James
0
Raghavendra HullurSoftware DeveloperCommented:
It won't work with just the file name in quotes as you mentioned it under hyperlink.

You need to have full path of the folder in which the files exists and refer the format I have provided.

Or for your easy reference, the file path should be in the format "C:\Users\Admin\Downloads\"&toText({test2.fileNumber}, '#')&'.pdf'

Where "C:\Users\Admin\Downloads\" is my local file path and you need to replace it with your actual folder path where the files exists.

{test2.fileNumber} is my database field which contains the values with same name as file names, so you need to replace that with your database field name.

As I mentioned in previous reply, you need to have same values as in your file names to get this working.

Hope this is clear.
0
Jeff SAuthor Commented:
I removed the quotes and it does not seem to do anything. I try double clicking on it and nothing opens.
0
Jeff SAuthor Commented:
Raghavenndra,

There are dozens of users scanning in documents from various locations in the company. They are all not consistent unfortunately on how and where the documents are stored. The "File Path" name tells me exactly where the file is ... I just need it to open versus having to copy and paste the address in a web browser. I wish they had it uniform and in one set location; however, they do not.
0
Raghavendra HullurSoftware DeveloperCommented:
Thanks for clarifying that Jeff.
I just checked based on James's suggestion and I could see that we can retrieve the files from different locations as long as we can refer the correct file names.

For the example, I placed 2 files in 2 different locations and stored file location path in database and I could retrieve the files from both locations based on the fileNumber I passed which had 1 and 2 as values.

Check the attached file and it simulates the details as you mentioned.
Hyperlink.rpt
0
mlmccCommented:
Try just dropping the field onto the report.

What data is it showing?

mlmcc
0
Jeff SAuthor Commented:
mlmcc,

The field is on the report - it is the link address.

Snipaste_2018-09-04_16-00-59.png
0
Raghavendra HullurSoftware DeveloperCommented:
Then you can use that file path database field itself under hyperlink as it contains full path along with file name.
0
mlmccCommented:
Is this from the Crystal Designer you are trying to open the PDF or is this form an end user viewing?

mlmcc
0
Jeff SAuthor Commented:
mlmcc -

I think you hit it on the head. I am going through the Medical Practice Management software to view the report and it may be restricting this somehow? Its not being viewed via the Crystal Designer.
0
mlmccCommented:
Try this

Open the report
Click on a field other than the hyperlink
Click the hyperlink field to see if it works
0
mlmccCommented:
Didn't see your comment on the viewing software.

The above comment probably won't make any difference.

You have it setup correctly
Try using  CTRL-Click or SHIFT-Click

mlmcc
0
James0628Commented:
You said earlier that you were double-clicking on the field.  This probably won't change anything, but, for the record, you should only need a single click to open the link.

 Did you try mlmcc's suggestion to click on something else first?  As I mentioned earlier, I ran into a similar issue (I sometimes had to click somewhere else in the report before clicking on a link).

 This may be obvious, but, if you can, try running the report from the Crystal designer and see if the links work there.  Or, if you have the Crystal designer software, but the reports have to be run through that other software for some reason, then you can:

 Create a new report.
 Put a "dummy" field on it (a simple text field or whatever).
 Copy one of the paths from that field in your original report and use that for the hyperlink for the "dummy" field.

 If you can open the link from that new report in the designer software, then the problem is probably a limitation of the software that's being used to run the reports (or possibly something different about the "environment").

 You can also try just replacing your field in the hyperlink formula with the URL for a PDF file on the Web.  For example, "http://www.pdf995.com/samples/pdf.pdf" (the first thing that came up in a Web search).  Don't forget the quotes (since this is just a literal string, not a field name).  If that link works, then the problem is apparently something in your links.

 What is TBIDMT?  Is that a system name?

 I noticed that some of the paths in your screenshot start with "http://TBIDMT/" and some start with "\\TBIDMT\".  The two different forms concern me.  First of all, have you tried clicking links in both forms?  It's possible that one works and the other one doesn't, so make sure that you've tried both.  If it turns out that one works and the other one doesn't, then the next trick will be trying to see if you can make the other one work.  If neither works, then if you try any other ideas to get the links working, you may want to make sure that you test them with both forms.  There may be something that works with one form, but not the other, and if you don't try both forms, you may miss it.

 James
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeff SAuthor Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.