There are two ways to put images into reports.
1) A static image stored in the RPT.
2) A dynamic image read from a path [formula] at runtime.
If the report always uses the same image, like a company logo, then option 1 is the simplest. Use the menu options
“Insert > Picture ” and select any of the supported file types. Once the file is placed on the report, the image can be resized as needed.
If the image periodically changes then you need option 2. For example, if different users want to be able to assign a different logo image file to the report without changing the report. Or if the image is based on a a file name name stored in the database like the image of a specific part. This method was added over 10 years ago with the release of CR XI (v11) so it will be available in most modern versions of CR.
To use option 2 you start by insert any image as a placeholder in the appropriate spot. Then you use the menu options:
“Format > Graphic > [picture tab]” and click the formula button to the right of the word “Graphic”. Here you can enter a file path or a URL to any of the Crystal supported image file types. The best part is that this path/URL can be a calculated string. This is how you can change the path or the file name based on values coming from the database. For instance, if the you have a folder called “PartsPix” and each part has a JPG image named as the part number, your ‘graphic’ formula could be something like this:
“z:\partspix\” & {Parts.Partno} & “.jpg”
The path will be different on each record, and so the image shown will change accordingly. Note if the image files are different sizes then the images shown will also vary in size.
(For examples of my most popular formulas, please visit the FORMULAS page on my website.)