Jump to content

Strange scriptlet behaviour


neowarp

Recommended Posts

Hello,

im currently working on integrating a report into an app and therefore created a scriplet to

preprocess my data. While doing so i stumbled accros a strange behaviour of the scriplet/ireport.

Ive stripped down the code and the report to the bare minmum but i cant find the cause.

The report contains a variable that calls a function in the scriptlet with a constant.

For some odd reason the function is called 3 times. Ive used a try catch to print out the stacktrace

and it seems that jasper calls this multiple times.

Is there anything that i am missing on how to use scriptlets here? From what im thinking the function

should only be called once and not three times.

Ive attached both the compiled scriptlet and source aswell as the report file is used for debugging.

The report output shows that the function is called three times.

Anyone has an idea?

 

Thanks in advance

neowarp

Link to comment
Share on other sites

  • 2 months later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

 Did you ever figure anything out on this?  I have the same issue and I just basically created a boolean condition around the core code in the java file so it only will run once.. But I have no idea why things are being called that many times.

 

 

Link to comment
Share on other sites

Sadly i was not able to really resolve the described issue.

 

The example i posted was really a very very stripped down version of the problem i had.

Funny enough i could resolve my problem differently (i had filters set in my query instead of

a where clause because i thought the filters were applied during data fetching and not afterwards)

 

Still i think there is a bug here. If you look at the trace, the scriptlet is already called twice before

afterReportInit() is even called followed by a final call. The example doesnt use any dataset so

that cant be the issue here eighter.

 

sorry that i cant be of much help here.

 

cheers

neowarp

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...