Another problem: even if I've found the Image class now, I'm not able to load an image at runtime.
Do I have to do anything different if I want to .Render() and .ExportDocument() instead of .Show() ?
I tried the following:
Code: Select all
...
rep.RegData(ds);
StiImage img = new StiImage();
img.Image = System.Drawing.Image.FromFile(@"c:\test.gif");
rep.Compile();
rep["Image1"] = img;
rep.Render();
rep.ExportDocument(StiExportFormat.Pdf, @"c:\test.pdf");
"Image1" is an empty image control on the Report Title Band.
I also tried what I found in the
Developer FAQ, chapter 8.13 (page 38):
Code: Select all
StiImage img = rep.GetComponents()["Image1"] as StiImage;
img.Image = System.Drawing.Image.FromFile(@"c:\test.gif");
rep.Render();
Or the second way:
Code: Select all
rep.Compile();
StiImage img = rep.GetComponents()["Image1"] as StiImage;
img.ImageToDraw = System.Drawing.Image.FromFile(@"c:\test.gif");
rep.Render();
No matter what I do, the result is always the same: the report is exported, but the image is not in it.
What am I doing wrong?