Friday, March 9, 2012

Pull an Image from a Database onto a Report Problems

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,
JWYou 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|||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
"Ravi R" <bofobofo@.yahoo.com> wrote in message
news:1110480130.355102.180250@.o13g2000cwo.googlegroups.com...
> 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
>|||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.
"Jeremy Wright" <jwright@.twostep.com> wrote in message
news:uXGxuMaJFHA.580@.TK2MSFTNGP15.phx.gbl...
>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
> "Ravi R" <bofobofo@.yahoo.com> wrote in message
> news:1110480130.355102.180250@.o13g2000cwo.googlegroups.com...
>> 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
>

No comments:

Post a Comment