此报告运行良好,突然之间出现以下错误消息
A BIRT exception occurred. See next exception for more information.
TypeError: Cannot find function getLong in object com.ibm.tivoli.maximo.report.script.MXReportDataSetImpl@4188e92b. (/report/data- sets/script-data-set[@id="1990"]/method[@name="fetch"]#29).
at org.eclipse.birt.report.engine.script.internal.DtEScriptExecutor.handleJS (DtEScriptExecutor.java:99)
at org.eclipse.birt.report.engine.script.internal.DataSetScriptExecutor.handleJS(DataSetScriptExecutor.java:256)
at org.eclipse.birt.report.engine.script.internal.ScriptDataSetScriptExecutor.handleFetch(ScriptDataSetScriptExecutor.java:143)
at org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.fetch(ScriptDataSetRuntime.java:103)
at org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$ScriptDSQueryExecutor$CustomDataSet.fetch(PreparedScriptDSQuery.java:260)
at org.eclipse.birt.data.engine.executor.cache.OdiAdapter.fetch(OdiAdapter.java:226)
at org.eclipse.birt.data.engine.executor.cache.RowResultSet.fetch(RowResultSet.java:145)
at org.eclipse.birt.data.engine.executor.cache.RowResultSet.doNext(RowResultSet.java:118)
at org.eclipse.birt.data.engine.executor.cache.RowResultSet.next(RowResultSet.java:96)
at org.eclipse.birt.data.engine.executor.cache.ExpandableRowResultSet.next(ExpandableRowResultSet.java:63)
at org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper.populateData(SmartCacheHelper.java:318)
下面是导致错误的用FETCH方法编写的代码。如果我将getLong更改为getString,那么它将正常工作。但是,我想了解是什么导致了该问题,因为它在没有任何问题的情况下可以正常工作。
commLogDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), "commLogDataSet");
commLogDataSet.open();
commLogSQL = "select commlog.message, commlog.ownerid
from commlog where commlog.commlogid = " + workLogDataSet.getDouble("worklogid")
;
commLogDataSet.setQuery(commLogSQL);
if(commLogDataSet.fetch()) {
row["recordkey"] = commLogDataSet.**getLong**("ownerid");
row["description"] = commLogDataSet.getString("message");
}
commLogDataSet.close();
}