Solved

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

Posted on 2003-11-14
4
283 Views
Last Modified: 2012-06-21
Hi,

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.
0
Comment
Question by:romeovoid
  • 2
4 Comments
 
LVL 13

Expert Comment

by:EwaldL
ID: 9752168
you can use the ole object's setolelocation command in a section event
- place an ole ojbject into the details section
- place the field that contains the image's path into the detail section
- in a section event read out the field value as shown in
http://support.crystaldecisions.com/communityCS/FilesAndUpdates/scr8_vb_rdc_retrievedata.exe.asp
- create an instance of the ole object in the detail section and set it's ole path to the value you read out from the database field. Something like

Dim myOleObject As CRAXDRT.OLEObject
Set myOleObject = CrReport.Sections.Item("D").ReportObjects.Item("1")
myOleObject.SetOleLocation = TheValueYouHaveAlreadyRead
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 9752347
0
 

Author Comment

by:romeovoid
ID: 9764555
Sorry, but I have to display my ignorance.

Most of the examples use a VB form to display the report.

Can I get this dynamic picture behaviour on a RPT document.  i.e., can I launch the rpt file in CR8 and apply the 'coded' OLE path value?
0
 
LVL 13

Accepted Solution

by:
EwaldL earned 125 total points
ID: 9766177
nope, it cant be done directly in crystal reports i am afraid. you will either have to do some coding or change the images themselves, not the paths, in the database.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

815 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

8 Experts available now in Live!

Get 1:1 Help Now