开发者

How to use a java Hashmap as variable in JasperReport

开发者 https://www.devze.com 2023-01-11 05:46 出处:网络
I wantto 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 f

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


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


I tried it there and got it working.

I set the following properties on the variable:

  • Variable class: java.util.HashMap()
  • Reset type: None
  • Calculation: System
  • Variable expression: new java.util.HashMap()
0

精彩评论

暂无评论...
验证码 换一张
取 消