all groups > sql server reporting services > march 2005 >
You're in the

sql server reporting services

group:

Pull an Image from a Database onto a Report Problems



Pull an Image from a Database onto a Report Problems Jeremy Wright
3/9/2005 6:47:51 PM
sql server reporting services: Does anyone know if the following is possible? If so, any pointers on how
to accomplish it?

I have a table in SQL 2000 containing two fields "StoredDoc" and
"StoredDocExtension".

The StoredDoc field is a ntext field. the StoredDocExtension is a char
field.

When uploading an image to the database, the image is stored directly in the
StoredDoc field. The file extension for the file is stored in the
StoredDocExtension field.

I want to create a report that will display the image stored in the
StoredDoc field directly on the report at runtime. If possible, I would
also like the MIME/Type property to be set based on the StoredDocExtension
field.

I have been trying to get this to work tonight and all I get is a red x
where the image should be.

Any suggestions?

Thanks,
JW

Re: Pull an Image from a Database onto a Report Problems Ravi R
3/10/2005 10:42:10 AM
You can set the MIME/Type property based on a database field using the
Properties tab of the image. I am not sure if thats what is you are
looking for.

Ravi
Re: Pull an Image from a Database onto a Report Problems Jeremy Wright
3/10/2005 1:58:35 PM
I was able to do that, but I am running into problems converting the image,
which is stored as a ntext value in the database to the actual picture, when
the report is run.

I wasn't sure if Reporting services was able to handle that or if you needed
to do something special to get the image to show up.

Thanks for the help.

JW
[quoted text, click to view]

Re: Pull an Image from a Database onto a Report Problems Robert Bruckner [MSFT]
3/10/2005 2:59:52 PM
Database images have to be byte arrays in Base 64 encoding.
You may want to try this image.Value expression (assuming your images are
not encoded as Ole-Images which is typical for Access databases):
=System.Convert.FromBase64String(Fields!ImageNTextColumn.Value)


-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.


[quoted text, click to view]

AddThis Social Bookmark Button