Jump to content
We've recently updated our Privacy Statement, available here ×

How to use myJavaClass as myVariable in Jasper?


itworker

Recommended Posts

I have create in Report variable with type of 'myJavaClass' (eg: 'Value Class Name' -> de.testlib.jasper.myJavaClass).

The JavaClass with the name 'myJavaClass.java' I created before: This JavaClass has getter and setter for Java variables. I need myJavaClass.java for manipulate the values I get from Jasper.

In next step I want to use this JavaClass as variable in Jasper as variable.

But I have a big problem how to define expresions (Initial Value Expression, Increment type, Incrementer Factory Class Name).

A) Initial Value Expression: 'new myJavaClass()'

B) Expression: '$V{myJavaClass}.add(3)'

In the groupefooter I have a field to get the value of '$V{myJavaClass}' with '$V{myJavaClass}.getData()'

When I start the Report I get the Exception with message, that it is not possible to set value in the JavaClass.

 

Why isn't possible to set value to myJavaClass with Jasper? I thing it should be possible, but how?

I'm looking for any ideas...

-itworker-

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Initial Value Expression: this should be default value which you want to pass to your java class

IncrementType: this should be your group(as you are using this variable in group footer)

Incrementer Factory Class Name: I've not worked on this yet.

Regards,

JasperExplorer

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...