Show Watermark on selected Pages

Stimulsoft Reports.NET discussion
Post Reply
vorauler
Posts: 71
Joined: Wed Jul 15, 2009 1:20 am

Show Watermark on selected Pages

Post by vorauler »

Hi

I must come back to this post after the upgrade to Version 2017.1.10 from 2015.3.0. The same sample as in 2011.
viewtopic.php?f=8&t=4417&p=19314&hilit=watermark#p19314

Code: Select all

var data = new List<ReportPrintValue>();
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 });
On the Page Event Rendering

Code: Select all

Page1.Watermark.Enabled = Insurant.ShowWatermark;
Page1.Watermark.Text = Insurant.WatermarkText
This produce the watermark on the page with record from Person2 and Person6 instead on Person1 and Person5.

Attached is my sample and hope you can give my a quick answer with the corretion. I couldn't attach the complete solution, the size was too big.

TIA
Ralf
Attachments
Form1.cs
(1.51 KiB) Downloaded 159 times
Watermark.mrt
(5.54 KiB) Downloaded 303 times
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Show Watermark on selected Pages

Post by HighAley »

Hello.

Please, try to use the Before Print event of the page.

Thank you.
vorauler
Posts: 71
Joined: Wed Jul 15, 2009 1:20 am

Re: Show Watermark on selected Pages

Post by vorauler »

Hello

Sorry for my late response but I was in holidays.

Your hint doesn't work for me. Now I get a watermark on page 1, page 2 and page 6 instead on page 1 and page 5.
Any other hint? Otherwise I must go back to the release 2015.X.X.?

Ralf
vorauler
Posts: 71
Joined: Wed Jul 15, 2009 1:20 am

Re: Show Watermark on selected Pages

Post by vorauler »

Hi

I have created a little sample that you will find here (Project WatermarkBug).
https://www.dropbox.com/s/q782imzezsilt ... s.zip?dl=0

Ralf
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Show Watermark on selected Pages

Post by HighAley »

Hello.

We have made some changes in your report.
Now it's working as expected.
We are using the Get Tag and After Print events of the Data band.

Thank you.
Attachments
Watermark.mrt
(5.72 KiB) Downloaded 306 times
Post Reply