$ P {REPORT_SCRIPTLET}有时/ always(?)不能在表达式中调用两次

时间:2016-06-17 08:59:02

标签: jasper-reports

我希望包含一个子报表,只要一个人不通过$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,以防它提供原因的线索。

1 个答案:

答案 0 :(得分:0)

在第二次调用中直接调用静态方法,但正常工作

<subreport>
  ...
  <subreportExpression>
     $P{REPORT_SCRIPTLET}.dbg( "subreport: ", EnvScriptlet.getMyRepPath() )
  </subreportExpression>
</subreport>