Page 1 of 1

Modifying report in code after template is loaded

Posted: Tue Oct 11, 2011 9:15 am
by jmiller
I have a report template (mrt) that my program loads with StiReport.Load(). It loads fine and renders fine, until I want to programatically change something like the watermark.
myReport.Load();
// Set the watermark on pages
StiWatermark waterMark = new StiWatermark();
waterMark.Font = myFont;
waterMark.Text = myWatermarkText;
myReport.Pages[0].Watermark = waterMark;
...
myReport.Render();

When it renders, it does not render the watermark. I've done similar things without using an mrt where the report is entirely programatically created. These watermarks work fine.

Modifying report in code after template is loaded

Posted: Wed Oct 12, 2011 3:11 am
by HighAley
Hello.
jmiller wrote:I have a report template (mrt) that my program loads with StiReport.Load(). It loads fine and renders fine, until I want to programatically change something like the watermark.
myReport.Load();
// Set the watermark on pages
StiWatermark waterMark = new StiWatermark();
waterMark.Font = myFont;
waterMark.Text = myWatermarkText;
myReport.Pages[0].Watermark = waterMark;
...
myReport.Render();

When it renders, it does not render the watermark. I've done similar things without using an mrt where the report is entirely programatically created. These watermarks work fine.
What version do you use?
We couldn't reproduce your issue. Please send us a sample project to reproduce the issue.

Thank you.