Image as variable in Silverlight - not displaying

Stimulsoft Reports.Silverlight discussion
Locked
ankaek
Posts: 28
Joined: Thu Jun 14, 2012 9:13 am

Image as variable in Silverlight - not displaying

Post 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.
Attachments
StimulsoftImageTest.zip
(7.61 MiB) Downloaded 569 times
ankaek
Posts: 28
Joined: Thu Jun 14, 2012 9:13 am

Re: Image as variable in Silverlight - not displaying

Post by ankaek »

Does anyone have any input on this? I'd really appreciate some help on this issue.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Image as variable in Silverlight - not displaying

Post 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.
ankaek
Posts: 28
Joined: Thu Jun 14, 2012 9:13 am

Re: Image as variable in Silverlight - not displaying

Post 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
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Image as variable in Silverlight - not displaying

Post 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.
ankaek
Posts: 28
Joined: Thu Jun 14, 2012 9:13 am

Re: Image as variable in Silverlight - not displaying

Post 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.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Image as variable in Silverlight - not displaying

Post by HighAley »

Hello.

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

Thank you.
Locked