我希望包含一个子报表,只要一个人不通过$P{REPORT_SCRIPTLET}
多次引用/调用scriptlet就可以了:
<subreport>
...
<subreportExpression>
/* "/myrep.jrxml" */ /* runs fine */
/* $P{REPORT_SCRIPTLET}.getMyRepPath() */ /* returns the above and runs fine */
/* the report runs to the fill phase and may or may not (both experienced)
* after some time return and say, e.g. that the file has not been found
*/
$P{REPORT_SCRIPTLET}.dbg( "subreport: ", $P{REPORT_SCRIPTLET}.getMyRepPath() )
</subreportExpression>
</subreport>
它基于Jasper Utils EnvScriptlet
,以防它提供原因的线索。
答案 0 :(得分:0)
在第二次调用中直接调用静态方法,但正常工作:
<subreport>
...
<subreportExpression>
$P{REPORT_SCRIPTLET}.dbg( "subreport: ", EnvScriptlet.getMyRepPath() )
</subreportExpression>
</subreport>