Friday, March 9, 2012

Displaying images from SSAS data source

I'm trying to display the images from the Adventure Works SSAS database in a SSRS report.

I've added an image object to the table, set MIME to image/jpeg (as it is set in the value fiel of the attribute in AW SSAS database) but I'm getting just a 'x' instead of the image and following output:

Preview complete -- 0 errors, 1 warnings

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

Preview complete -- 0 errors, 1 warnings

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

Preview complete -- 0 errors, 1 warnings

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

[rsInvalidDatabaseImage] The Value expression for the image ‘image1’ did not evaluate to an image.

Preview complete -- 0 errors, 2 warnings

But displaying images the same way just using the relational AW DW table DimProduct works well.

(the only difference I've seen is: in the query generator from SSAS there is a cryptic text value displayed as the value of the LargePhoto attribute, if using relational table there is a '<binary>')

relational query:

select productalternatekey, largephoto from dimproduct

SSAS query:

WITH MEMBER measures.test

AS

[Product].[Large Photo].currentmember.membervalue

SELECT NON EMPTY

{ [Measures].[Internet Sales Amount], measures.test } ON COLUMNS,

NON EMPTY { ([Product].[Product].[Product].ALLMEMBERS * [Product].[Large Photo].[Large Photo].ALLMEMBERS) } ON ROWS

FROM [Adventure Works]

Where is the problem ? How can I display images from SSAS in SSRS ?

Any ideas are appreciated.

Jan.

A binary member value comes from SSAS as Base64-encoded. You need to use the following expression in your textbox Value property in SSRS:

=System.Convert.FromBase64String(Fields!test.Value)

|||

Great help Teo!

That's it, thanks a lot !

Jan.

No comments:

Post a Comment