I have implemented the following code
Code: Select all
var report = new StiReport();
var reportPath = @"C:\Users\james_000\Documents\Visual Studio 2013\Projects\ReportTest\Templates\Dynamic.mrt";
report.Load(reportPath);
Stimulsoft.Report.Components.StiPage newPage = report.Pages[0].Clone() as Stimulsoft.Report.Components.StiPage;
var image = newPage.Components[newPage.Components.IndexOf("Image1")] as Stimulsoft.Report.Components.StiImage;
image.ImageURL = new Stimulsoft.Report.Components.StiImageURLExpression("http://tweeterism.com/wp-content/uploads/2013/04/LOL-Cat.jpeg");
report.Pages.Add(newPage);
report.Compile();
report.Render();
StiPdfExportService pdfExport = new StiPdfExportService();
pdfExport.ExportPdf(report, @"C:\Users\james_000\Documents\Visual Studio 2013\Projects\ReportTest\output\dyanmic.pdf");
Code: Select all
error CS0102: The type 'Reports.Report' already contains a definition for 'Page1'
Sample application with the report template can be found here to view the problem in action.