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

Dynamically place image in CR XI report

Status
Not open for further replies.

CrystalLion

Programmer
Jan 3, 2007
113
US
I have a table of gift information indexed by giftno: 1,2,3,4,etc.

I have a folder of images as jpg files. The image file names match the giftno.

Where gift.giftno = 1, the image file is image\1.jpg

Don't know if I needed to, but I have created an Images Excel sheet, so that on the first data row

column a = 1 and
column b = the hyperlink to image\1.jpg

I want to create a list report that shows:
Gift number 1 and it's associated image
Gift number 2 and it's associated image
etc
etc

How do I do this?
 
The easiest way is to place all 4 images on your report, each in there own section.

In the section expert conditionally suppress section.
eg for image 1
giftno <> 1

Section will only show for giftno = 1

Alternatively, place all 4 in same location and then conditionally suppress each image using the same rules above

Ian
 
What if the gift table and image folder have thousands of records and images? This is not a limited scenerio. I am trying to manage document imaging and display the images in a truly dynamic way without having to conditionally suppress sections of a report for each image. Any thoughts?
 
Is the link a directory and file name on your machine/server or is it an internet location?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
I actually figured out a way to do this.
Place the images in a folder.
C:\Documents and Settings\MyName\My Documents\Images\
Create a formula that calculates (or maps) the table.fieldname to the image #. (this could be a do while)
{@Image} formula =
if {sql_Gifthistory.GiftNum} = 1 then
"00001.jpg"
else
if {sql_Gifthistory.GiftNum} = 2 then
"00002.jpg"
else
if {sql_Gifthistory.GiftNum} = 3 then
"00003.jpg"

Insert one of the images as an OLE.
Right click on the image and select:
Format Graphic
Picture
Graphic Location
Enter the graphic folder address in the Format Formula Editor box.
Be sure to put quotes around the folder address to make it a string.
Then put + {@Image} after it.
The entire Graphic Location should look like this.
"C:\Documents and Settings\MyName\My Documents\Images\" + {@Image}

I hope this helps anyone else who is trying to do this.
 
The other way would be to create a table with two colunms. GiftNo and a blob field containing the image.

Ian
 
Speak to your DBA. They should be able to help you create table and then load in your images and giftno fields.

In Oracle its something like

CREATE TABLE IMAGESTORE
( "GIFTNO" number(6),
"IMAGE_DESCRIPTION" VARCHAR2(200 BYTE),
"IMAGE" BLOB
)

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top