linking a pdf file to a report

In the main report (group header), very general employee data is displayed. When the report is executed, from the list of employees shown, the user can then click on any particular record and subsequently more specific information is shown about that particular employee. This is done via subreport in the DETAILS section (which is hidden).

The question is how can I also display a picture from a pdf file related to that particular employee?

There are many pdf files in the directory containing the specific file (picture) that we need to display. Each file is named uniquely as an employee number, which happens to be the same linking method used to link the main report with the subreport, so hopefully that's a plus.

As a note, there could be data about an employee shown in the report but not all employees have a pdf file, so if the user clicks on a particular employee record and there is no pdf file, we just don't want the report to crash.

Thanks for any help!

hilfy

New member
Oct 31, 2003 2,556 0 0 US

I'm not sure whether Crystal XI has the feature to dynamically set locations on OLE Objects or not and I don't have a copy of XI installed right now. If it does, here's what you do:

1. Add an OLE object to your report and point it to a "dummy" pdf file.

2. Right-click on the object and select "Format Graphic. " (Yes, Crystal thinks all OLE objects are pictures, but that's ok.)

3. Go to the Picture tab and click on the button for "Graphic Location".

4. Enter the path to the files with the field from your data that identifies the file name.

This should dynamically load the file. Crystal won't crash if the file doesn't exist, but it will show the dummy file you pointed to in step 1.

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year

Kim296

MIS
Aug 24, 2012 98 0 0 US Your explanation does work. This is how I was able to retrieve a photo in our system.

wiplash

MIS
Jun 29, 2004 99 0 0 US

Definitely appreciate the response, but apparently I'm just not doing something right because I seem to get the "dummy" pdf file I created regardless of whether there's an actual picture that SHOULD display or not. Not sure what's up.

Does it matter if the OLE object is in the subreport or the main report? I added another detail section to the main report, then just the subreport, then both, and . the same response. Any thoughts?

hilfy

New member
Oct 31, 2003 2,556 0 0 US

Have you set the graphic location based on your data? If you're running this on a web server, is the folder where the images are located part of the website? If not, your app will not be able to find them due to security issues.

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year

wiplash

MIS
Jun 29, 2004 99 0 0 US

Dell,
Thanks again but I think that's indeed where I'm going wrong. When I click on the "button" for "graphic location", the formula workshop opens. What do I enter as a formula?

I have a new pdf file I saved in the directory (the one that says "none found") with the other pdf's (pictures), and not sure I understand number 4 you mentioned earlier. Can you clarify?

hilfy

New member
Oct 31, 2003 2,556 0 0 US

Where is the location of the files? Are you storing that information in the database or are you just storing the file name? Or is the file name based on some information in the record?

In the formula you need to identify where the pdf file is located and what its name is so that Crystal can find it and open it.

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year

wiplash

MIS
Jun 29, 2004 99 0 0 US

Where is the location of the files? Are you storing that information in the database or are you just storing the file name? Or is the file name based on some information in the record?

In the formula you need to identify where the pdf file is located and what its name is so that Crystal can find it and open it.

The location of the files (pdf's) are in a directory on a separate server, not the one where the report will be stored. Yes, the files are just a bunch of pdf files and I want to run the report and it display the "matching" file.

I can't simply put the directory path as a formula because Crystal won't accept that as a "valid" formula. I may just be making this more complicated than what is really should be, but here's basically what I'm trying to do .

I have a main report which allows the user to enter a last name.
When the user enters a last name, I show the records and some basic (a little more detail) data about those records. (And there could be multiple records with that last name.)
The user then clicks on the employee they want to see information about.
Within my report, I have a subreport (hidden) (matching on employee number) (and no, the user probably didn't know the number originally), and the detail is shown, and HOPEFULLY, THE CORRECT PICTURE IF THERE IS ONE, OTHERWISE THE "dummy" PDF (also in that same directory) THAT SHOWS A BLANK PICTURE (with a message on it that says NONE FOUND).

Can you give me an example of a "valid" formula for that?