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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display jpg`s from a remote server in CR8 report

Status
Not open for further replies.

romeovoid

Programmer
Nov 14, 2003
4
US
I`m trying to use LINKED OLE object in a
report that displays and employee picture,
name and department.

The picture files are stored on the server
as \\server\img\emp001.jpg. Where the
employee number, name and department can be
obtained from the employee table in a SQL
server db.

First problem: I cannot get the jpg picture
to be viewed in preview or when printed, all
I get is graphic representing a jpg icon.

I can however INSERT a jpg PICTURE and get
the picture viewed.

2nd problem: How do I change the picture
being displayed on the report based on
constructing a path to the image file.
i.e., path = "\\server\img\emp"+{EmpNo}
+".jpg". How do I modify the path property
of EITHER the OLE object or PICTURE object.

I would prefer to use a linked OLE object
due to rpt size considerations.

Thanks

ps. I have to use jpg files in the report
and I need the picture to change with each
record being printed.
 
Well, I can't directly answer your question, but I would ask one of my own: Does you database support the storing of images? (for example, SQL Server or Oracle would.) If so, do you have the rights to add the images to your database? Managing your images through a database is a much preferred method than using linked ole objects, especially when you want the image to change with each record.
 
Unfortunately, it's too late in the game to start storing images in the rmdbs.

The jpg's are stored on the server.
 
For your first problem, are you running the report from within Crystal Designer and not getting the linked OLE Object to work, or via some other method (web, CE, RDC)? I believe that Crystal needs access to an application that can act as an OLE server when you use a linked object, so if there is no application on the pc that you are running CR that can edit jpg files, I don't think you'll be able to link them. I could be wrong, but I think that is how it works.

If the images are not in a database, how are you going to get a different image per record? Even using the linked OLE object, you would need to be able to change the image at runtime. This is do-able via the RDC, but I'm not aware of a way to do it if you are running the report in Crystal Designer or deploying via RAS/CE. And even with the RDC, it's very slow and would pretty much require either hardcoding your vb or having a table to pull from that would match up id's with image files.

Now, if you are thinking of trying to do that, why not just take an MS Access file, put in in the same location as the pictures, load the pictures into a table that stores the image and the Employee ID, and then use a subreport, connected to the Access file and linked via the employee id, to bring back the image? Your performance wouldn't be any worse than using the RDC to change the file location on every new record. And this process could work no matter how you deployed the report.
 
Thanks for responding:

The Linked OLE Object shows an image in CR8 if I use a bmp instead of a jpg image. Microsoft Office Picture Manager (Office 2003) opens the bmp and the jpg if I directly double click the file. I would believe that Picture Manager would act as an OLE server.

I was hoping that I could write some basic formula within the designer that would change the path property of the linked OLE object, as in; path = "\\server\img\emp"+{EmpNo}
+".jpg".

I'm not familiar with the RDC.

Also, I am trying to develop a cutomization for a product that I cannot directly modify. It saves pictures to disk and not db to conserve db size.

I was just hoping that Crystal Reports 8 would be able to display jpg's as it does bmp's in reports. I am somewhat forced to work within the constraints of the system that is already in place. And, jpg's on disk are what I have to work with.

I like your idea about storing the images in an Access db, but am unsure as to how to automatically have the image get inserted in the db as it is placed in the folder by the product (that I cannot modify). Come to think of it, maybe it could be saved in a SQL Server db.

Your further thoughts would be much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top