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

Displaya table with Column total and row total


AnnMary.Thomas
Go to solution Solved by marianol,

Recommended Posts

I need to display he data in the following format

 

 2001200220032004....sum
data11020101050
data22020202080
data330202030100
sum60605060 

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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

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

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