Groups | Blog | Home
all groups > sql server reporting services > may 2005 >

sql server reporting services : Image and text values not displayed in header or footer


Goitom
5/27/2005 2:36:02 PM
I have a report in which I need to display an Image in the header, that is
coming from Database or sometimes an alternative text in place of the image.
Both ways I couldn't do it.
Case Text: I have tried several ways such as using ReportItem Parameters,
but the problem is the text is displayed in the first page of a group. If the
group region needs morethan one page when the report is rendered then the
next pages will not have the header or footer text.

Case Image: No means at all!!!!!

Is there any way of achieving this? Please help ...
--
Robert Bruckner [MSFT]
5/27/2005 7:11:41 PM
There is an option on the Grouping and Sorting Properties dialog to repeat
group headers/footers. If you select the checkbox, the group header will be
repeated and hence the referenced reportitem value will show up in page
header/footer.


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


[quoted text, click to view]

Goitom
5/31/2005 4:16:22 PM
Thanks Robert,

You are right, I will check this out but how about the image? Your solution
could be used only for the case of text field. But still I am not able to
display an image logo in the header of the report that needs to be repeated
in all the pages and its source is database


--
Goit


[quoted text, click to view]
Robert Bruckner [MSFT]
5/31/2005 7:16:32 PM
It sounds like you want the same image to show up in the header of every
page. There are several options to achieve this:
* use an "embedded" image in the report. This works well if the image is
e.g. a company logo.
* use a "project" image which is part of the report solution. The image will
get published as resource to the report server
* use a "web" image (aka external image) - which requires at least RS 2000
SP1.

If you really need the image to come from the database, you can do the
following:
* add a dataset DImage to the report which retrieves the image data - e.g.
as ImageData column.
* add a new report parameter PImage of type String. Make the parameter
hidden (non-prompted). Set the parameter default as query-based and choose
ImageData as column.
* add a new Image report item in the page header/footer. Set the image type
to "Database". For the image value expression use =Parameters!PImage.Value.
Don't forget the set the mimetype correctly.


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


[quoted text, click to view]

Goitom
6/1/2005 7:22:09 AM
Thanks a lot, I have tried this approach several times with different
techiniques but the end result is that the image box control shows the no
image icon.

--
Goit


[quoted text, click to view]
Robert Bruckner [MSFT]
6/1/2005 10:05:11 AM
Are you sure the image is really stored as image in the database (rather
than being stored as OLE image, which for instance Access would do)?

If it is stored as OLE image, you have to get rid of the OLE header. If the
bitmap was created on an English system, the OLE header is 78 bytes (e.g. on
Spanish it would be 88 bytes). Use the following image value expression to
make the image show up (79 == header length + 1):
=System.Text.Encoding.Default.GetBytes(Mid(System.Text.Encoding.Default.GetString(Fields!Picture.Value),79))
Alternatively, you can use the following expression (which only works for
images created on an en-US system!):
=System.Convert.FromBase64String(Mid(System.Convert.ToBase64String(Fields!Picture.Value),105))

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


[quoted text, click to view]

AddThis Social Bookmark Button