1
Vote

Database driven images not showing in non-english systems(solved)

description

This report
 
(SS: Catalog.rdlc - http://northwind.codeplex.com/SourceControl/changeset/view/5795#141684)
 
didn't display pictures for me. As I didn't find it very likely for Shamil not to leave a note of some issue if this really should be the case, I looked for other possibilities for the cause of this error. Further, when I previewed the dataset in VS, the pictures did display in the grid, thus the pictures had to be present.
As the pictures are read directly from a field in the database, I guessed somehow the Report Viewer got it wrong but how?
 
After some googling I located this page which is to the point and had a very good explanation of the issue which is a localization issue:
 
http://forums.devarticles.com/showpost.php?p=51707&postcount=3
 
As the pictures had been stored most likely in an English version, I tried with the value of 79 for the length of the header as the article suggests:
 
=System.Text.Encoding.Default.GetBytes(Mid(System.Text.Encoding.Default.GetString(Fields!Picture.Value),79))
 
VoilЮ! The pictures are displayed!
 
Now, the really clever thing would be to expand the expression to retrieve the length of the header automatically so a picture could be stored and retrieved by any combination of localizations.

file attachments

comments