Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use a java Hashmap as variable in JasperReport

I want to use a java.util.HashMap as variable in JasperReport to save group names of my report in it.

I have tired and declared a variable of type java.util.HashMap and its expression field is:

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

but it does not works and gives null when I print it on report's group footer.

I am using iReport 3.7.3

like image 763
Zeeshan Avatar asked Nov 06 '22 10:11

Zeeshan


1 Answers

You wrote that Variable expression: new java.util.HashMap() I think it might be initial value expression instead of variable expression

like image 189
Mihir Avatar answered Nov 11 '22 04:11

Mihir