Page 1 of 1

Image with changing file name

Posted: Tue May 03, 2011 2:00 pm
by dpeel2757
Hi,
I have a list of images located on my local disk that get created on the fly with changing file names. These files name also get populated in the database I am reporting on. I would like to display these images in the report but have been unable to accomplish this.

So I have a CombinedParts table with a partname column and a filename column that looks like this:

Part Name - File Name
Base Adj Shelf - 510008FE
Base Back - 510008FK
Base Bottom - 510008FQ
Base Left Side - 0008IX48

Then on a specific location on my local disk I have the corresponding picture files:
510008FE.jpg
510008FK.jpg
510008FQ.jpg
0008IX48.jpg

I'm trying to use the image component to look to the CombinedParts find the records filename and then somehow go grab the picture located on disk.

I have tried setting up an image variable and then assigning the variable to the image component in my databand. Then in the Begin Render event I have tried using the following:

Variable1 = Image.FromFile("C:\DXF Image\" & CombinedParts.File_Name & ".jpg")

The image component manages to go and grab a picture file but the picture isn't changing for each record and the picture that is displaying isn't linked to the record that is currently being displayed. So the first record is Base Adj Shelf but it is showing the base Left side picture for all the records.

Am I missing something in order to get this to display and report correctly?

Image with changing file name

Posted: Tue May 03, 2011 2:43 pm
by Brendan
You can use the ImageURL property of the image component.

You can set the value to something like this:

Code: Select all

C:\DXF Image\{CombinedParts.File_Name}.jpg

Image with changing file name

Posted: Tue May 03, 2011 3:14 pm
by dpeel2757
Thanks!! That is much easier than everything I setup. When I was tried that property before it was giving me and error but seems like it might have been the pictures i was using. Thanks again.

Image with changing file name

Posted: Thu May 05, 2011 6:35 am
by Ivan
Hello,

We are always glad to help you.
Let us know if you need any additional help.

Thank you.