The only way that I know how to do this is with the Crystal Reports RDC. I am assuming that you have the path to the picture stored in your database, if so follow these basic steps.
1. Place a picture box (Picture1 - ICROleObject)in the section that you want the picture to appear (Section3).
2. Place a field that will pull the path of the picture from the database (field1), and set its suppress property to true. You don't want this to appear on the report.
3. Place the following code in the section Format event of the report.
Private Sub Section3_Format(ByVal pFormattingInfo As Object)
Set Picture1.FormattedPicture = LoadPicture(Field1.Value) 'changes the picture in the section
End Sub
That's all there is to it. You can place this a details section and have a different picture for each record.
Just note the report has to be converted to a DSR to get a formatting event for the section. You can't do this with RPT files unless you convert the RPT to a DSR. The article about this is on CD's website, article# C2004336. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
I glad. Take the time to post your solution. It will help someone else down the road and I would be interested in it if you found another possibly better method. Thanks and Good Luck!
The March Crystal Clear has a description of four methods to do this, and I've added a FAQ on Tek-Tips with the same information.
cViewIMAGE is a COM data driver that you configure to identify the table and field with the image name. It then presents the image to the report in a COM data set.
The SMTP UFL takes a different approach and can burst a report into seperate email messages. The messages can be formatted HTMl and can include embedded images.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.