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

Variable wants to add a starting value but Initial Value Expression didn't work


skyer20032003

Recommended Posts

This is my variable setting:

 

Name: test

Value Class Name: java.lang.Integer

Calculation: Sum

Expression:$F{RPTBAMF_NUMBER}

Initial Value Expression:$F{RPTBAMF_INIT}

Increment type:None

Reset type: Report

 

I want to add RPTBAMF_INIT as my starting value, but no matter how you do it, it does not work.

I also tried adding 5 or new Integer(5), The result is still does not work.

 

Any help would be greatly appreciated.

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Let me confirm your question.

For example, here is the report
Does 'Your test' in the first line mean that '25' is the expected value, not '20'?
w20220917_variable_preview.png.195c1be220e5a301d8ecf69121c717c0.png


If my understanding of the above is correct, then one solution to get '25' is as follows

1. Create a 'test_init_val' in Variable.
w20220917_variable_design_1.png.95d0122eb8154cb4c6d903f857f8c26a.png

2. Write '$V{test_init_val}+$V{test}' in the Text Field expression.
w20220917_variable_design_2.png.f7b4938a913e27f7dfb10c763a0dce7c.png

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