How to use java hashmap as a variable in JasperReport

I want to use the java.util.HashMapas variable in JasperReport to store the group names of my report in it.

I got tired and declared a type variable java.util.HashMap, and its expression field:

$V{variable1}.put($F{GROUPCOLUMNVALUE}, $F{GROUPCOLUMNVALUE})

but it doesn’t work and gives nullwhen I print it in the footer of a report group.

I am using iReport 3.7.3

+5
source share
2 answers

You wrote that Expression of a variable: new java.util.HashMap() I think it may be initial value expressioninstead of an expression variable

+1
source

I tried it there and got his job.

I set the following properties for the variable:

  • : java.util.HashMap()
  • Reset : None
  • : System
  • : new java.util.HashMap()
0

All Articles