AnnMary.Thomas Posted June 20, 2014 Share Posted June 20, 2014 I need to display he data in the following format 2001200220032004....sumdata11020101050data22020202080data330202030100sum60605060 My sql query is select year, data1, data2,data3 from table1. Year data1,data2,data3 are allseparate columns in the table. Cross tab does not help in this case Link to comment Share on other sites More sharing options...
Solution marianol Posted June 20, 2014 Solution Share Posted June 20, 2014 The column total is very easy, just drop your fields in the column footer and JasperSoft studio will ask you if you want to agregate the result (select SUM) and will create the proper variables for you.For the row total create a variable, let say ROW_TOTAL and in the variable expression add all the fields you want to add i.e.: $F{sales-01} + $F{sales-02} +$F{sales-03}.... and then in the last column just print your variable $V{ROW_TOTAL}For more info on working with variables, look at chapter 9 in the JSS user guide http://community.jaspersoft.com/documentation/v56/jaspersoft-studio-user-guide 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