Page 1 of 1

How to add a Watermark?

Posted: Wed Mar 21, 2012 7:00 am
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

How to add a Watermark?

Posted: Thu Mar 22, 2012 7:05 am
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.

How to add a Watermark?

Posted: Wed Mar 28, 2012 4:05 am
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

How to add a Watermark?

Posted: Wed Mar 28, 2012 4:44 am
by Stephan1
Hi Mietzekotze,

you have to set the watermark enabled.

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

Cheers

stephan

How to add a Watermark?

Posted: Wed Mar 28, 2012 5:34 am
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?

How to add a Watermark?

Posted: Wed Mar 28, 2012 5:42 am
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

How to add a Watermark?

Posted: Wed Mar 28, 2012 10:36 am
by mietzekotze
Thank you. That was it :)