Page 1 of 2

event in java code

Posted: Thu Apr 16, 2020 1:45 am
by simon ren
in my application,i user reportjs in my web and use report-java in my server.

first i use code in event like "beforePrint","afterPrint","beginRender","Rending","endRender" in reportjs
second i need render my report in server by java.

but i found when i render in server by report-java the event when i use in reportjs doesn`t work

how can i use event code in reportjs and render it in report-java?

Re: event in java code

Posted: Fri Apr 17, 2020 9:10 pm
by Lech Kulikowski
Hello,

In the JS product, events very limited.
Could you explain your issue in more detail which code are you use in events?

Thank you.

Re: event in java code

Posted: Mon Apr 20, 2020 2:55 am
by simon ren
Lech Kulikowski wrote: Fri Apr 17, 2020 9:10 pm Hello,

In the JS product, events very limited.
Could you explain your issue in more detail which code are you use in events?

Thank you.
1.I use code below in js product
The attachment reportjs.png is no longer available
2.in my server i load the js product`s mrt file and render
server.png
server.png (49.07 KiB) Viewed 9683 times
but the code in the event doesn`t work,it doesn`t add a new page when line is 5
结果.png
结果.png (70.55 KiB) Viewed 9683 times

Re: event in java code

Posted: Mon Apr 20, 2020 9:14 am
by Lech Kulikowski
Hello,

Please check the following code:

Code: Select all

if (DataBandName.line == 5)
this.engine.newPage();
Thank you.

Re: event in java code

Posted: Thu Apr 23, 2020 3:50 am
by simon ren
Lech Kulikowski wrote: Mon Apr 20, 2020 9:14 am Hello,

Please check the following code:

Code: Select all

if (DataBandName.line == 5)
this.engine.newPage();
Thank you.
thanks, i try it but it doesn`t work.

Re: event in java code

Posted: Thu Apr 23, 2020 9:20 am
by Lech Kulikowski
Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.

Re: event in java code

Posted: Sun Apr 26, 2020 10:16 am
by simon ren
Lech Kulikowski wrote: Thu Apr 23, 2020 9:20 am Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.
here is the report.mrt and test data,thank you
format.mrt
(11.54 KiB) Downloaded 625 times
data.json
(1004 Bytes) Downloaded 562 times

Re: event in java code

Posted: Mon Apr 27, 2020 10:40 am
by Lech Kulikowski
Hello,

You should use the following code in the BeforePrint event of the databand, not for the page:
if (DataCommonCmp2020.line == 5)
this.engine.newPage();

Thank you.

Re: event in java code

Posted: Tue Apr 28, 2020 1:49 am
by simon ren
Lech Kulikowski wrote: Mon Apr 27, 2020 10:40 am Hello,

You should use the following code in the BeforePrint event of the databand, not for the page:
if (DataCommonCmp2020.line == 5)
this.engine.newPage();

Thank you.
thank you,i try it,use your code in the BeforePrint event of the databand,but it does`t work when i render it in java

the following pics is the event and rended pdf
event.png
event.png (111.37 KiB) Viewed 9368 times
result.png
result.png (77.51 KiB) Viewed 9368 times

Re: event in java code

Posted: Sat May 02, 2020 10:43 am
by Lech Kulikowski
Hello,

Sorry for the misunderstanding. Events are not supported in the Java version.

Thank you.