Discussion Locked

dynamically change the photos in report

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Sir/Madam,

how to dynamically change the photos in crystal report from vb

i have a table(employee) with three fields(empno,empname,imgpath), where empno contains the employee number(1001), empname contains the employee name(rakesh), and imgpath contains the file path of the photo of that employee(c:\photos\1001.jpg(or 1001.gif,1001.bmp,1001.tiff)).

i want to prepare a report for this table using crystal report, i can place the fields(empno,empname) in the crystal report, but how do i dynamically get the corresponding photo of the employee.

please explain with a sample code including the crystal report.

with regards,

B.Senthil Kumar

5 replies

by sl-campbell

There are two ways that I know of and I will list one of them here:

Create a "dummy" picture file and save it with a unique name in the same folder as the CR rpt.
Open the report and link this "dummy" picture to an OLE Blob field on the report.
In your VB program, when the user selects a record to review or print with CR, get the path and name for the picture and do a FileCopy as the "dummy" file name and path.
When the report opens, it will refresh automatically and import that picture

This discussion is closed to new replies.