cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports Dynamic Image

Former Member
0 Kudos

I am looking for some assistance on how to dynamically change an image (logo) on a report based on a value in a database field in the report.  Ex. If oitm.itemsgrpcod = 138, then display image \\servername\path\image001.jpg, else display image \\servername\path\image002.jpg      My thought is that I need to create a formula (formula1234), then reference it in the graphic properties under Format Graphic / Picture Tab / Graphic Location.  

Thanks in advance for any assistance with creating the formula and linking to the graphic.  (Hopefully I'm on the right track here...)

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Jeff,

Yes, you're on the right track.

1) Go to Insert > OLE Object > Bitmap Image/Paintbrush Picture > Place the object on a section

2) Right-click the OLE Object > Format Graphic > Picture tab > click on the formula button beside 'Graphic Location' and insert the path of the image (with the quotes). For e.g:

"\\servername\path\image001.jpg"

Hope this helps.

-Abhilash

Former Member
0 Kudos

Thanks Abhilash.  I am able to display the image referenced using the instructions you provided.  The next step I need is a formula to select the appropriate image based on a value in a database field in the report (see original post).   Thanks again for any further assistance you may be able to provide.

abhilash_kumar
Active Contributor
0 Kudos

That would be:

"\\servername\path\"&{database_field}&".jpg"


-Abhilash

Former Member
0 Kudos

Would this work?

If {OITM.ItmsGrpCod} = 138 then "\\ServerName\Path\image001.jpg" else "\\ServerName\Path\image002.jpg"

abhilash_kumar
Active Contributor
0 Kudos

Yes!

-Abhilash

Former Member
0 Kudos

Thank you!  I had the path incorrect at first which was causing the issue.  It is working 100% now.  THANKS!

Answers (0)