cancel
Showing results for 
Search instead for 
Did you mean: 

Referencing an Image in Crystal Reports

Former Member
0 Kudos

Hi All,

Let me explain my situation. I need to find a way to reference and image file stored in a central repository, and link it to a code inside of CR. The image files are automatically named thusly when added to the system: "[STOCK-CODE] 00001.jpg".

I have attempted to link the file using a simple formula such as "\\locale\images\{stock.stock_code} *.jpg" but it returns nothing.

Anyone have any ideas?

Thanks,

Andy.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Andrew,

Try:

'\\locale\images\'&{stock.stock_code}&'.jpg'


Does the Stock Code contain the entire image name? Like so:


StockCodeXYSS.jpg


-Abhilash

Former Member
0 Kudos

Hi Abhilash,

Yes the image is named using the full code, so for example "APLTSBRASA..L14X7   00001.jpg" where the full code is "APLTSBRASA..L14X7" and the system applies an incremention to the image to avoid overlapping, hence "00001" at the end.

Have tried your soloution, unfortunatly no success as yet, but thank you for looking at it for me!

Andy

abhilash_kumar
Active Contributor
0 Kudos

The database field include the '.jpg' as well?

If it does, then try:

'\\locale\images\'&{stock.stock_code}


-Abhilash

Former Member
0 Kudos

No the database field is just the code, so "APLTSBRASA..L14X7" for example

-Andy

abhilash_kumar
Active Contributor
0 Kudos

And what about the 00001 at the end of the name?

Is it always 00001 for all images?

Is there a space between name and 00001?

-Abhilash

Former Member
0 Kudos

Hi,

Yes there is a 00001 added automatically when the image is processed. There is typically a space or two depending on the length of the code, however I am looking possibly to remove this, as it currently only serves to allow multiple images to be related to the same code within another program. for example, here are a few codes with their spacing intact:-

As you can see, the number of spaces can change, which is why I thought of using a wildcard, but so far it does not work.

Andy

abhilash_kumar
Active Contributor
0 Kudos

That is going to be an issue.

You should first get rid of all the spaces in the filename and then try this code:

'\\locale\images\'&{stock.stock_code}&'00001.jpg'


-Abhilash

Former Member
0 Kudos

That seems to have done it. I will alter the program used to encode the image with the stock code to eliminate the spaces.

Many thanks for your help!

Andy

Answers (0)