jyoti.doddagoudar Posted March 21, 2014 Share Posted March 21, 2014 I'm printing a report in which i need to fetch previous and current value from the same colomn of the table and subtract those values and print it. 1.I m not getting how to fetch previous and current value from the same colomn 2.how to store fetched values using variables and to perform subtraction on them. Info:Data type of colomn field used in table is Integer Please Help me Link to comment Share on other sites More sharing options...
hozawa Posted March 22, 2014 Share Posted March 22, 2014 Just create 2 variables. Example, V${CURRENT_VALUE} and V${OLD_VALUE}. Set V${CURRENT_VALUE} to F${your_field} and V${OLD_VALUE} to V${CURRENT_VALUE}. The trick is to order V${OLD_VALUE} before theV${CURRENT_VALUE} in the Outline view.JasperReports evaluates variable expression in the order they appear in the Outline View so V${OLD_VALUE} is evaluated before V${CURRENT_VALUE} is updated with the current field value. Link to comment Share on other sites More sharing options...
jyoti.doddagoudar Posted March 24, 2014 Author Share Posted March 24, 2014 I tried but getting the same values for both V${OLD_VALUE} and V${CURRENT_VALUE} variables.I m not sure about changing the order u mentioned.please guide me how do i need to change the order wrt to those variables. Link to comment Share on other sites More sharing options...
jyoti.doddagoudar Posted March 24, 2014 Author Share Posted March 24, 2014 change order of the variable in the sense setting them either as ascending or descending order? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now