Show Watermark on selected Pages
Posted: Fri May 20, 2011 1:26 am
Hello
I would show a watermark on selected pages on a report.
For that I use the BeforPrint event of the page object.
The simplified code for printing is
Now I thought I get a watermark on page1 and page5, but I get a watermark on page1, page2 and page6.
Can I use the watermark for my purposes or is there an other procedure to achive this?
Ralf
I would show a watermark on selected pages on a report.
For that I use the BeforPrint event of the page object.
Code: Select all
Page1.Watermark.Enabled = Insurant.ShowWatermark;
Page1.Watermark.Text = Insurant.WatermarkText
Code: Select all
private void PrintReport()
{
var data = new List();
data.Add(new ReportPrintValue { Nachname = "Person1", Vorname = "Test", ShowWatermark = true, WatermarkText = "Person1 Watermark" });
data.Add(new ReportPrintValue { Nachname = "Person2", Vorname = "Test", ShowWatermark = false });
data.Add(new ReportPrintValue { Nachname = "Person3", Vorname = "Test", ShowWatermark = false });
data.Add(new ReportPrintValue { Nachname = "Person4", Vorname = "Test", ShowWatermark = false });
data.Add(new ReportPrintValue { Nachname = "Person5", Vorname = "Test", ShowWatermark = true, WatermarkText = "Person5 Watermark" });
data.Add(new ReportPrintValue { Nachname = "Person6", Vorname = "Test", ShowWatermark = false });
data.Add(new ReportPrintValue { Nachname = "Person7", Vorname = "Test", ShowWatermark = false });
StiReport report = new StiReport();
report.Load(Application.StartupPath + @"\\Watermark.mrt");
report.Compile();
report.RegData("Insurant", data);
report.ShowWithRibbonGUI();
}
class ReportPrintValue
{
public string Nachname { get; set; }
public string Vorname { get; set; }
public bool ShowWatermark { get; set; }
public string WatermarkText { get; set; }
}
Can I use the watermark for my purposes or is there an other procedure to achive this?
Ralf