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

SET VALUE OF VARIABLE EXCEPT IN "Variable Expression"


andogates

Recommended Posts

Hi, i new to user Jasper report,

as long as in know, to set variable value we must declare that on Variable Expression, but if like that i must know the pattern of my variable value in advance..

the problem is the value is depending on some condition which we know after that condition printed. So difficult for me  to set my variable expression/value in "Variable Expression".. http://community.jaspersoft.com/sites/all/libraries/ckeditor/plugins/smiley/images/sad_smile.gif

Can we set/change value of variable except in Variable Expression statement??

For example in "Text Field Expression" maybe,,,

 

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi Andogates,

 

I am not clear with your exact requirement. but as far i understand your problem, you want to print some conditional result and once it is printed you want to print some other variable's value.

For above solution you can follow these steps :

(1) Create one variable and assign initial values

(2) Create Text Field element where you will put your condition in text field expression.

(3) Create next text field and apply logic/ expression in Text Field Expression section to print some value on base of that expression.

(4) Change property of the "Evaluation Time" to "Band" for the second text field.

check your report now. I had similar kind of requirement few times ago in one of my application and I had followed same steps and it was working for me.

Hope same is working for you also......!!!!

 

 

Link to comment
Share on other sites

Thank's dipesh.bhavsar,

 

but sorry, i not really understand about step number 3,,

for examples, i have one variable with name 'vData', and i print that in my first text field (set vData in Text Field Expression),

and then i want changed or increment vData value when my second text field printed, so i think i must assign that's statement/logic (for changed vData value) in second text field in 'Text Field Expression',,

like this : $V{vData}.setValue(3);

the main problem is how syntax to setValue variable in some condition..

sorry for my bad explanation,

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