atmaling Posted January 31, 2013 Share Posted January 31, 2013 Hi,I want to take sum of previous 2 rows and display it in 3rd row as below: Consider my query has three fields as Shop, Item and Stock as below, I want to take sum of stock and display it in 3rd row.Shop | Item | StockShop1 | Item1 | 10 Shop2 | Item1 | 20 Total | Item1 | 30 Shop1 | Item2 | 15 Shop2 | Item2 | 25 Total | Item2 | 40How it's possible using scriptlets? or any other way ?As I couldn't find much more help on scriptlets on any site. Please help me...Thanks in Advance...!!! Link to comment Share on other sites More sharing options...
sanbez Posted January 31, 2013 Share Posted January 31, 2013 There is always the sum of only two records? What are you do if Shop3 will be added? Use group and sum by group. See http://community.jaspersoft.com/system/files/documentation/ireport-ultimate-guide.pdf 7.2 Working with Groups Link to comment Share on other sites More sharing options...
ernestoo Posted January 31, 2013 Share Posted January 31, 2013 Another approach is an interesting one where you can gain access to previous record values - you can see the technique as shown by Teodor on this Tech Talk video: http://www.youtube.com/watch?v=UcbTzeJMfiY 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