Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Static OLE object to be embedded into a Crystal Report

Status
Not open for further replies.

yosteevo

IS-IT--Management
May 8, 2012
42
US
Static OLE object to be embedded into a Crystal Report

I need to configure a crystal report to have the ability to embed (.JPG image files and/or an Excel files).
I am working with a LIMS database that manages raw data for a chemistry lab that allows end users to upload files as test result data via .JPG images and/or Excel files.
This data needs to be included into my reports as static OLE objects.
The files need to be graphically visible so they can be printed out as a hard copy.

I have a LIMS database table/field that pulls the file name of each unique file I wish to embed. With this file location information, I need to write a script that will (open – convert – embed) into my report.
Again, these files are different for each report.




Thanks to anyone who may be able to help…

Stephen
 
If each student report is given its own file name and you want to pair it with it's corresponding JPG, Then try the following:

1. Click Insert Picture and find a JPG image that will be your placeholder, should one of your files not have an image to go with the file. Maybe something that says "item not available"
2. Right click ont the image Go to Format Graphic
a. Click on Picture Tab
b. Click on the formula button next to "Graphic Location:"
3. Type in the drive:\directory and any subfolders where your photos will be found. then add
+ Trim({location.database}) + ".jpg"

See Sample below.
"C:\Photos\" + Trim({Table.field}) + ".jpg"

**Don't forget the quotation marks***

Essentially, Crystal will pull up any JPGs with the same name as your file.

This will only work if the JPG name is the same as your data file name. For example, Data file is ABC123. Then your JPG name has to be ABC123. Crystal Reports will match up the pairs. If they don't match then you'll get your default placeholder image mentioned in step 1.
 
Hello msi30502,

Thanks for the response.


The file names of the image file and/or Excel files will be different and changing all the time.
This did not seem to work.

Here is the code I tried using:
"D:\BlazeLIMS Data\Attachments\BlazeLIMS\TestDoc\" + Trim ({doc_file.df_filename}) + "Image.jpg"



To recap:
The database field "{doc_file.df_filename}" is the actual field that has the file location that will always be pointing to different named files for each report run.
 
What about the links in your tables? Is "{doc_file.df_filename}" linked correctly to the table that keeps your raw data? Are they in the same database or seperate ones?
 
{doc_file.df_filename} is in the same database.
It is also pulling the correct data when I right-click and browse the data from that field. I see all my image/file names in the popup window.

It may be an issue with the files residing on a secure database I may have to share the directory or change the security settings for this folder that these images get saved to by the LIMS software.

 
Oops! Sorry, thought I was posting on another forum.

======
I am definately sure it has to do with your linking. I've had the same issue with using attached photos to the database. Eventually, I had to work around it and do as I mentioned above.

Sorry I'm not skilled enough to help you further on this topic.

Best of Luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top