gpt4 book ai didi

grails - 嵌套Jasper表达式

转载 作者:行者123 更新时间:2023-12-02 14:37:39 28 4
gpt4 key购买 nike

我有一个字段($P{ORDER}.permit),它是Integer(0,1),我想将其显示为String(“否”,"is")。所以我在ResourceBoundle下面添加了键:

order.permit.0=No
order.permit.1=Yes

我写了 $R{order.permit.$P{ORDER}.permit}表达式,但是不起作用。引发异常

net.sf.jasperreports.engine.JRException: Too many groovy classes were generated. Please make sure that you don't use Groovy features such as closures that are not supported by this report compiler.



我怀疑此异常是由嵌套jasper表达式或以错误的方式嵌套它们引起的。

我应该如何编写表达式以达到期望的结果?

编辑:str("order.permit." + $P{ORDER}.permit)是答案。详情请见下文。

最佳答案

使用str()而不是$R{}

另请参阅http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=54665:

$R{} and str() are largely the same thing. The functional difference is that $R{} can only be used with fixed/static keys, while str() can be used with dynamic message keys, e.g. str("message.prefix." + $P{message}).

关于grails - 嵌套Jasper表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6831109/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com