Project: Birt
Bug 123722 Java based scripting -> getExpressionValue(int i) of IRowData returns unreasonable value
Reported: 2006-01-13 01:18:08 | Status: closed fixed

public void onPrepare( IRow row, IReportContext reportContext ) { try { row.setBookmark( "\"row-bookmark\"" ); System.out.println( row.getBookmark( ) ); } catch ( Exception e ) { e.printStackTrace( ); } } public void onCreate(IRowInstance rowInstance, IReportContext reportContext) { try { IRowData rowData = rowInstance.getRowData( ); Object int2 = rowData.getExpressionValue( 1 ); System.out.println( int2 ); } catch ( Exception e ) { e.printStackTrace( ); } } Consider the script above, according to Javadoc, rowData.getExpressionValue( 1 ) will return the first data expr. of the row, i.e. the value of the first column. However, it was noticed that "row-bookmark" was returned instead. And if i used rowData.getExpressionValue( 2 ), then i got the right value. So if it was the correct implementation, it should be clearly stated in Javadoc.

Files changed in fix:
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/executor/GridItemExecutor.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/executor/ListItemExecutor.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/executor/ListingElementExecutor.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/executor/TableItemExecutor.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/script/internal/CellScriptExecutor.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/script/internal/ElementUtil.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/script/internal/GridScriptExecutor.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/script/internal/RowData.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/script/internal/RowScriptExecutor.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/script/internal/instance/CellInstance.java