Page 1 of 1

Set watermark text and color by JS code

Posted: Wed Jul 03, 2019 5:07 pm
by mrapi
Hi
using Stimulsoft 2019.3.2+Angular I need to set watermark text and color by code
in VB.net code I use this:

Code: Select all

report.Pages(0).Watermark.Text = "MyText"
  report.Pages(0).Watermark.TextBrush = New Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.LightGray)
tried in Js/Angular:

Code: Select all

this.report.pages[0].watermark.text = "MyText";
but got:
ERROR TypeError: Cannot read property 'watermark' of undefined
thanks

Re: Set watermark text and color by JS code

Posted: Thu Jul 04, 2019 8:45 pm
by Lech Kulikowski
Hello,

Do you need to set it in the code of the report or in your project?

Thank you.

Re: Set watermark text and color by JS code

Posted: Fri Jul 05, 2019 5:24 am
by mrapi
Hi
not in report code,outside,in JS
thanks

Re: Set watermark text and color by JS code

Posted: Tue Jul 09, 2019 10:26 am
by Lech Kulikowski
Hello,

We need some additional time to investigate the issue.

Thank you.

Re: Set watermark text and color by JS code

Posted: Thu Aug 08, 2019 10:11 am
by mrapi
Hi,any progress on this?
thanks

Re: Set watermark text and color by JS code

Posted: Wed Aug 14, 2019 7:30 am
by Lech Kulikowski
Hello,

Please try to use the following code:
report.pages.getByIndex(0).watermark.text = "MyText";
report.pages.getByIndex(0).watermark.textBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(Stimulsoft.System.Drawing.Color.lightGray);

Thank you.

Re: Set watermark text and color by JS code

Posted: Wed Aug 14, 2019 12:31 pm
by mrapi
it is working.thanks

Re: Set watermark text and color by JS code

Posted: Thu Aug 15, 2019 7:06 am
by Lech Kulikowski
Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.