Page 1 of 1

How to display image on image control on stimulsoft report

Posted: Mon Apr 01, 2013 12:01 pm
by nicegaurav
Hi,
Facing problem to display image on image control, when using mrt file on visual studio, on the other end all content of the report display. On testing purpose pass Image URL on mrt it is working fine on designer and image is showing on the report but when I call the report through visual studio it is not displaying image on report.
Please help me out,
Below is the code which I used for this.. if any modification required please let me know.

StiReport report = new StiReport();
report.Load(@"D:\GraphTest.mrt");
report.Compile();
StiImage Img = report.GetComponents()["Image1"] as StiImage;
string strGraphName = @"D:\Image.emf";

System.Drawing.Image myImage = System.Drawing.Image.FromFile(strGraphName);
Img.Image = myImage;
report.Render();
StiPdfExportService pdfExport = new StiPdfExportService();
pdfExport.ExportPdf(report, reportPath);

Re: How to display image on image control on stimulsoft repo

Posted: Mon Apr 01, 2013 12:20 pm
by Alex K.
Hello,

Please try to use the following code:
report.Compile();
StiImage Img = report.CompiledReport.GetComponents()["Image1"] as StiImage;

Thank you.

Re: How to display image on image control on stimulsoft repo

Posted: Tue Apr 02, 2013 1:20 pm
by nicegaurav
thanks :)

Re: How to display image on image control on stimulsoft repo

Posted: Tue Apr 02, 2013 1:43 pm
by Alex K.
Hello,

We are always glad to help you!
Let us know if you need any additional help.

Thank you.