How to add a Watermark?

Stimulsoft Reports.NET discussion
Post Reply
mietzekotze
Posts: 39
Joined: Tue Dec 20, 2011 8:07 am
Location: Germany

How to add a Watermark?

Post by mietzekotze »

Hey guys,

could you provide a sample, how to add a watermark during runtime?
I've looked around, but couldn't find examples.

Which libraries do i have to import?

Kind regards
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

How to add a Watermark?

Post by Alex K. »

Hello,

You can use the following code:
report.Pages[0].Watermark.Angle = 45;
report.Pages[0].Watermark.Text = "MyWatermark";
...


Can you please describe your task in details?

Thank you.
mietzekotze
Posts: 39
Joined: Tue Dec 20, 2011 8:07 am
Location: Germany

How to add a Watermark?

Post by mietzekotze »

Hi Aleksey,

ok, my problem was, that i programmed in VB.Net and didn't replace these '[' with these '('.
I dont get an error report now, but also the water mark is not shown. is it possible, that this is because i use the demo files?

Kind regards
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

How to add a Watermark?

Post by Stephan1 »

Hi Mietzekotze,

you have to set the watermark enabled.

report.Pages(0).Watermark.Enabled = true

Cheers

stephan
mietzekotze
Posts: 39
Joined: Tue Dec 20, 2011 8:07 am
Location: Germany

How to add a Watermark?

Post by mietzekotze »

Hey Stephan,

doesn't work, either. Probably it's something really stupid i forget. I have this:

report.Pages(0).Watermark.Enabled = True
report.Pages(0).Watermark.Angle = 45
report.Pages(0).Watermark.Text = "MyWatermark"

before i load the report. Do i have to mind something else?
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

How to add a Watermark?

Post by Stephan1 »

mietzekotze wrote:Hey Stephan,

doesn't work, either. Probably it's something really stupid i forget. I have this:

report.Pages(0).Watermark.Enabled = True
report.Pages(0).Watermark.Angle = 45
report.Pages(0).Watermark.Text = "MyWatermark"

before i load the report. Do i have to mind something else?
What you mean with before load ?

before using StiReport.Load(filename) ?

if so, you have to set the watermark after loading the report. If you set it before loading it will be overwritten by loading the report.

thx
mietzekotze
Posts: 39
Joined: Tue Dec 20, 2011 8:07 am
Location: Germany

How to add a Watermark?

Post by mietzekotze »

Thank you. That was it :)
Post Reply