Page 1 of 1

Image as variable in Silverlight - not displaying

Posted: Tue Aug 21, 2012 12:16 pm
by ankaek
Hi

I am about to deploy my application with Stimulsoft reports. The company I work for is about to purchase licenses for the Silverlight controls (we already have licenses for WPF.) So this is an exciting week!

I have been asked to place a image in one of the reports. The source is a Uri. A variable has been set in the report template. I read on a different thread that the SIlverlight viewer cannot use the URL directly so I am creating a BitmapImage in codebehind.

I am able to use this BitmapImage in the xaml file, but it does not get displayed in the report. A sample project is attached. Your help is much appreciated.

Re: Image as variable in Silverlight - not displaying

Posted: Thu Aug 23, 2012 8:03 am
by ankaek
Does anyone have any input on this? I'd really appreciate some help on this issue.

Re: Image as variable in Silverlight - not displaying

Posted: Thu Aug 23, 2012 12:19 pm
by HighAley
Hello.

Unfortunately, due to Silverlight restrictions it's impossible to load data from file.
There is no data in the BitmapImage and you could get it neither from local file nor from remote host.

Thank you.

Re: Image as variable in Silverlight - not displaying

Posted: Fri Aug 24, 2012 7:47 am
by ankaek
Thank you for the reply. What do you mean when you say that there are no data in the Bitmap image? In the sample project I use the bitmap image as the source for a common Silverlight image. And it displays. It is only in the report it is not displaying. I am sorry to bother you again with this, but as it stands now it seems like I cannot send an image to the Stimulsoft report as a variable. Displaying a logo from a configuration setting is a major demand from the project owner for my application so I need to be able to explain this to them and be sure to be correct.

Regards,
Ann

Re: Image as variable in Silverlight - not displaying

Posted: Fri Aug 24, 2012 1:40 pm
by HighAley
Hello.
ankaek wrote:Thank you for the reply. What do you mean when you say that there are no data in the Bitmap image? In the sample project I use the bitmap image as the source for a common Silverlight image. And it displays. It is only in the report it is not displaying. I am sorry to bother you again with this, but as it stands now it seems like I cannot send an image to the Stimulsoft report as a variable. Displaying a logo from a configuration setting is a major demand from the project owner for my application so I need to be able to explain this to them and be sure to be correct.
NExt code doesn't get image:

Code: Select all

logo2.UriSource = new Uri("http://upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Asker_komm.svg/90px-Asker_komm.svg.png", UriKind.RelativeOrAbsolute);
It's impossible in Silverlight to load image from external link.
You could add image as string or as byte[].
It's a Silverlight restriction.

Thank you.

Re: Image as variable in Silverlight - not displaying

Posted: Mon Aug 27, 2012 1:30 pm
by ankaek
Thank you. My workaround will be to get the images on a server we control (clientaccesspolicy.xml) so that the image can be converted to byte.

Re: Image as variable in Silverlight - not displaying

Posted: Tue Aug 28, 2012 5:26 am
by HighAley
Hello.

It's a right solution of your problem.
Let us know if you'll get any problems else.

Thank you.