how to Sum total row in jasper report

0

I want to add all the columns in row wise. and also i want to add the cross tab sum.  and also please tell me how to add the rows with date(i want to add all the columns if the date is same)

Please refer the table below.

Sub 2001 2002 2003 2004 2005 2006 Total Grand Toal
abcd 100 200 200 200 100 100 900 900
efgh 200 200 100 150 150 300 1100 900+1100
ijkl 150 200 300 500 200 150 1500 900+1100+1500

 

rams1231's picture
Joined: Aug 25 2019 - 5:32pm
Last seen: 1 week 2 days ago

2 Answers:

1

Hi rams

The way you sum it also depends on the way you're filling it.

If it's the same field (from 2001 to 2006) you can make a variable $V{Total} with:
Expression: $F{Number}
Calculation: sum
Reset type: the *GroupName* where you're putting every row.

I'm also kinda new in jasperStudio, can you give more info about how are you working with the values?

gabrieltcb's picture
Joined: Oct 24 2019 - 1:32am
Last seen: 4 days 20 hours ago
1

Hi there,

i did it like :
-create variable grand_total
-default expression is 0
-expression is : $V{GRAND_TOTAL}+$F{FIELD_NAME}
-put the variable in the table
note if u want to reset the grand total, the step @gabriel told us is the way!
damn why ur name is gabriel :')

also make sure both variable and field is BigDecimal type

im also new to jasper, hello fellow newbies :D

regards - TV

trvpseudo's picture
Joined: Jan 30 2019 - 11:02pm
Last seen: 3 days 18 hours ago
Feedback