Reputation:
Can I put java code inside the .jrxml?
For example, I want to put an if() or a "new ..()"
Is it possible? How?
Thanks
Upvotes: 5
Views: 7820
Reputation: 546
use Scriptlet
Jasper Design Studio 6.2 Professional ,
Eclipse Mars.1 Release (4.5.1)
The full tutorial Scriptlet Example in Jaspersoft 6.x for begineers - Hello World Sample Example
Upvotes: 0
Reputation: 597016
You can't put any code, you can only put expressions. So, you can put:
new Something(someParameter)
somebool.booleanValue == true ? new Something() : new OtherThing()
;but you can't use if
, for
, switch
, declare methods or classes.
Upvotes: 5