I have a SQL Server 2005 table, with the following columns:
1. filename - nvarchar(255), null
2. mimetype - nvarchar(256), null
3. documentbody - text, null
I have a query like this:
Select tbl.[mimetype] as Img_Type, tbl.documentbody as Img_Scan
from tbl
where tbl.[filename]='xyz.GIF'
I tested the query from the Query Analyzer, it returns one single record, with the correct fields values.
I created a Reporting Services report and I added an Image element having the following settings:
- MIMEType=First(Fields!Img_Type.Value); I also changed it to MIMEType=image/gif but the result was the same;
- Source = Database;
- Value =Fields!Img_Scan.Value
For testing purposes, I displayed First(Fields!Img_Type.Value) in a textbox - and it displayed "image/gif", which is correct.
I also displayed Fields!Img_Scan.Value in a textbox - and I got the textdump of my image, identical to the one returned by the query analyzer (something like "R0lGODlhUwKeAfcAAAAAAPPzwJWVmWNjSff31jIyJNbWp4yMbBkZEMXFnP...")
But the Image element displays only a red X, as for an unavailable image.
Where am I doing wrong?
I need to mention that I am not allowed to modify the table definition (such as changing the column type from text to image), since the database belongs to CRM.
Any idea is very much appreciated, thank you in advance.
Manu