Set watermark text and color by JS code

Stimulsoft Reports.JS discussion
Post Reply
mrapi
Posts: 277
Joined: Sat Dec 20, 2008 1:08 am

Set watermark text and color by JS code

Post 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
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Set watermark text and color by JS code

Post by Lech Kulikowski »

Hello,

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

Thank you.
mrapi
Posts: 277
Joined: Sat Dec 20, 2008 1:08 am

Re: Set watermark text and color by JS code

Post by mrapi »

Hi
not in report code,outside,in JS
thanks
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Set watermark text and color by JS code

Post by Lech Kulikowski »

Hello,

We need some additional time to investigate the issue.

Thank you.
mrapi
Posts: 277
Joined: Sat Dec 20, 2008 1:08 am

Re: Set watermark text and color by JS code

Post by mrapi »

Hi,any progress on this?
thanks
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Set watermark text and color by JS code

Post 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.
mrapi
Posts: 277
Joined: Sat Dec 20, 2008 1:08 am

Re: Set watermark text and color by JS code

Post by mrapi »

it is working.thanks
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Set watermark text and color by JS code

Post by Lech Kulikowski »

Hello

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

Thank you.
Post Reply