Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Display databound images in page header

Author  Topic 

rameshpalla
Starting Member

16 Posts

Posted - 2006-01-10 : 08:03:46
Hi all,

I have a problem in displaying databound images in page header.

I have done as is stated in the below article.

----X----
http://msdn2.microsoft.com/en-us/library/ms159677(en-us,VS.90).aspx

Adding a Databound Image to a Header or Footer
You can use image data stored in a database in a header or footer. However, you cannot reference database fields from the Image control directly. Instead, you must add a text box in the body of the report and then set the text box to the data field that contains the image (note that the value must be base64 encoded). You can hide the text box in the body of the report to avoid showing the base64 encoded image. Then, you can reference the value of the hidden text box from the Image control in the page header or footer.

For example, suppose you have a report that consists of product information pages. In the header of each page, you want to display a photograph of the product. To print a stored image in the report header, define a hidden text box named TXT_Photo in the body of the report that retrieves the image from the database and use an expression to give it a value:

=System.Convert.ToBase64String(Fields!Photo.Value)

In the header, add an Image control which uses the TXT_Photo text box, decoded to show the image:

=System.Convert.FromBase64String(ReportItems!TXT_Photo.Value)


----X----

but I am not getting the image.
The error message displayed is like this

[rsInvalidExpressionDataType] The Value expression used in image ‘image2’ returned a data type that is not valid.

Can any one help me in this regard.

Thanks in advance.
Ramesh

rameshpalla
Starting Member

16 Posts

Posted - 2006-01-18 : 05:03:13
Hi,

Can some one help me in this regard, Is my Question too easy or difficult? I tried but am not getting the image. Where I went wrong.

Rgds,
Ramesh
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-01-18 : 09:19:26
If i am understanding YOU...

are you using ASP, .NET or VB ?

Store the image path in your database. And do a response.write(<%=recordset%>) in your page
Go to Top of Page
   

- Advertisement -