Page 1 of 1

How to load and image dynamically to a report

Posted: Tue Nov 16, 2010 12:09 am
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..

How to load and image dynamically to a report

Posted: Tue Nov 16, 2010 7:09 am
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.