views:

570

answers:

2

Hello,

I have 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 fileds from that table. But the image is showing as blank.

Any thoughts, How I can make it work?

A: 

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))
Raj More
Thanks Raj More. When I right click on the control in the Crystal Report Designer how do I format it.
acadia
I am trying this using VS.net 2008. I created a sample report and drag and dropped few columns from the SQL server table. One of them is of image datatype. The one with Image datatype is showing blank though there are images in the database. When I right clicked on blob object I don't get options to place the code as you shown above. Any help greatly appreciated.
acadia
right click Blob object and go to properties and under `VALUE` put the code
Raj More
A: 

Hi Raj, I have the same problem displaying image in crystal report in .net . I am using the crystal report version 10 comes with .net when I click on the blob field in crystal rteport I can see only oprtion for format object I do not see the option properties and value .Pelase advice .Any help would be apreceated . Thank you