0

I am new to JasperReports and iReport designer. Now I have table in that I have a column salary . So I want to display the sum of all employees salary. for that I took a table from pallet created dataset. It displays the table perfectly , in footer I want to display the sum of salary so I created a variable SalSum here is the properties of it,

class: java.math.BigDecimal
calculation: sum
ResetType:Report
Variable Exp: $F{salary}

The problem is , The sum of salary is not displaying and getting the discription as Variable not found:SalSum and The table also displays 3 times in report how to solve this please help me anyone.

Alex K
  • 22,315
  • 19
  • 108
  • 236
Raghu
  • 1,324
  • 7
  • 24
  • 47

2 Answers2

1

You can simply drag salary field to the footer area.Then it asks field value or result of aggregation function.You have to choose the second option and from there you select the Sum.That's it

Chatz
  • 338
  • 2
  • 10
0

the problem is that you might not use the correct tag for the sum,

<textFieldExpression>

you need to use for summing inside ireport.

here is a nice tutorial about how to implement it

aurelius
  • 3,946
  • 7
  • 40
  • 73