How to display a binary image in a crystal report

This topic seems to be very confusing to most people. There are a lot of solutions available, but as yet we have not found one site on the net that explains the simple answer. Displaying images in crystal reports is a common requirement, and is very easy to do. This example will show you how to insert an image into your report from a stored procedure. This is by far the easiest way to acheive a very professional report.
Firstly you will need the image to be in the SQL database, which is not covered here as it is not within the scope of the article. Once you have an image in the database (stored in an image datatype column), write a stored procedure that returns the required column. Set this stored procedure as the data source for the report.
Now the easy part... displaying the image in the report. The secret is all to do with the driver that you use for your Crystal Report. Do not use the standard SQL Server driver, as this is no good for images. Rather use the OLEDB Provider SQL Server driver. That is all you need. You will be able to drag the column that contains the image straight onto the report, and it will display immediately and refresh automatically. No more headaches with SQL Server and Crystal Report images!

Add Feedback