How to load and image dynamically to a report

Stimulsoft Reports.WPF discussion
Post Reply
snair
Posts: 3
Joined: Mon Oct 04, 2010 3:37 pm
Location: U.S

How to load and image dynamically to a report

Post by snair »

Hi,

I have a report with image control on it. Am trying to load image dynamically to the report through code..Is there a way to do it?.. if so please help me. Am getting some Report.ReportIntialisation failed error..
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

How to load and image dynamically to a report

Post by Alex K. »

Hello,

You can add Image component in report and use the following code:

Code: Select all

StiReport report = new StiReport();
report.Load("e:\\Report.mrt");
StiImage stiImage = report.GetComponents()["Image1"] as StiImage;
Image myImage = Image.FromFile(@"e:\Image.jpg");
stiImage.Image = myImage;
report.Show();
Also you can see the article on our knowledgebase
http://stimulsoft.helpserve.com/index.p ... icleid=115


Thank you.
Post Reply