本文介绍了如何在JasperReport中将java Hashmap用作变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在JasperReport中使用 java.util.HashMap
作为变量来保存报告的组名。
I want to use a java.util.HashMap
as variable in JasperReport to save group names of my report in it.
我累了并声明了一个类型为 java.util.HashMap
的变量,其表达式字段为:
I have tired and declared a variable of type java.util.HashMap
and its expression field is:
$V{variable1}.put($F{GROUPCOLUMNVALUE}, $F{GROUPCOLUMNVALUE})
但是当我在报告的组页脚上打印时,它不起作用并给出 null
。
but it does not works and gives null
when I print it on report's group footer.
我正在使用iReport 3.7.3
I am using iReport 3.7.3
推荐答案
你写了
变量表达式: new java.util.HashMap()
我认为它可能是初始值表达式
而不是变量表达式
You wrote thatVariable expression: new java.util.HashMap()
I think it might be initial value expression
instead of variable expression
这篇关于如何在JasperReport中将java Hashmap用作变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!