Search code examples
vb.netcrystal-reports

Displaying Image from SQL Server in Crystal Reports


I have a couple of images in my SQL Server 2008 table of which the datatype is image.

In my VS.net 2008 project I have a crystal report which is displaying all the fields from that table, but the image is showing as a blank image.

Any thoughts, How I can make it work?


Solution

  • You have to convert the image before you can show it.

    In crystal reports, you can click on the image control and set the value property of the control to the following (replace ImageFieldName with your field name)

    System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!ImageFieldName.Value), 105))