Use if in event

Stimulsoft Reports.JS discussion
Post Reply
Maxduf
Posts: 1
Joined: Wed Apr 24, 2019 3:46 pm

Use if in event

Post by Maxduf »

Hello,

I'm trying to write a if condition into Before Print event like this : GroupFooterBand1.enabled = {IIF(GroupLine > 1), true, false)};
It doesn't work and i tried the order form of if on the documentation and some solution on the forum.

Can someone help me?
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Use if in event

Post by Lech Kulikowski »

Hello,

Unfortunately, events are not supported in the JS version.

Thank you.
SOLUNE - Jérémy
Posts: 3
Joined: Mon Oct 05, 2020 3:03 pm

Re: Use if in event

Post by SOLUNE - Jérémy »

Hi,

does this feature will be added in a (not so far i hope) futur ?

Regards
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Use if in event

Post by Lech Kulikowski »

Hello,

Yes. We are working on that feature, it will be available in the near future.

Thank you.
SOLUNE - Jérémy
Posts: 3
Joined: Mon Oct 05, 2020 3:03 pm

Re: Use if in event

Post by SOLUNE - Jérémy »

Hi,

any news for this feature ?

Regards
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Use if in event

Post by Lech Kulikowski »

Hello,

Please check the last release build.

Thank you.
SOLUNE - Jérémy
Posts: 3
Joined: Mon Oct 05, 2020 3:03 pm

Re: Use if in event

Post by SOLUNE - Jérémy »

Lech Kulikowski wrote: Mon Jan 18, 2021 11:58 pm Hello,

Please check the last release build.

Thank you.
OK, I see that the event Before Print and After Print are now present.

Now, how can i force a page break with a condition ?

I found this kind of syntax, but i can't make it work :
if (Products.ProductsName == "PageBreaks"){Data1.StartNewPage = true;}

Regards
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Use if in event

Post by Lech Kulikowski »

Hello,

You can use the following code:

Code: Select all

if (Products.getData("ProductsName") == "PageBreaks")
this.engine.newPage()
Thank you.
Post Reply