【问题标题】:BIRT Reporting: how to access LinkedHashMap in scriptBIRT 报告:如何在脚本中访问 LinkedHashMap
【发布时间】:2014-04-03 09:24:13
【问题描述】:

在创建 BIRT 报告时,我试图通过 rhino 脚本在报告 beforeFactory 事件中访问 LinkedHashMap。能够打印地图。但是,当我使用 size() 之类的任何方法时,会引发以下错误

找不到尺寸

var test1 = reportVO.getTest();   // "test" is a LinkedHashMap
log(test1)                                 // --> In the logs, im able to see the LinkedHashMap contents printed
(log test1.size())                       // --> this fails.

我已经导入了 util 包。

我读到了 org.eclipse.birt.core.script.NativeJavaLinkedHashMap。我也尝试访问此类的 LinkedHashMap thro' 方法,例如

test1.getIds()      // Method from NativeJavaLinkedHashMap --> this fails too

找不到getId

是否有特定的方法可以在脚本中访问 LinkedhashMap。

谢谢, 毗湿奴神

【问题讨论】:

    标签: birt


    【解决方案1】:

    你用过 test1.length 吗?您现在正在访问 javascript 变量而不是 java 变量 For More Click Here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多