Bug 123722 Java based scripting -> getExpressionValue(int i) of IRowData returns unreasonable value
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.
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/script/internal/ElementUtil.java
import org.eclipse.birt.report.engine.content.impl.ImageContent;
import org.eclipse.birt.report.engine.content.impl.LabelContent;
import org.eclipse.birt.report.engine.content.impl.RowContent;
import org.eclipse.birt.report.engine.content.impl.TableBandContent;
import org.eclipse.birt.report.engine.content.impl.TableContent;
import org.eclipse.birt.report.engine.content.impl.TextContent;
import org.eclipse.birt.report.engine.executor.ExecutionContext;
import org.eclipse.birt.report.engine.ir.GridItemDesign;
import org.eclipse.birt.report.engine.ir.TableItemDesign;
import org.eclipse.birt.report.engine.script.internal.element.Cell;
import org.eclipse.birt.report.engine.script.internal.element.DataItem;
import org.eclipse.birt.report.engine.script.internal.element.Grid;
import org.eclipse.birt.report.engine.script.internal.element.Image;
import org.eclipse.birt.report.engine.script.internal.element.Label;
import org.eclipse.birt.report.engine.script.internal.element.List;
import org.eclipse.birt.report.engine.script.internal.element.ReportDesign;
import org.eclipse.birt.report.engine.script.internal.element.ReportElement;
import org.eclipse.birt.report.engine.script.internal.element.Row;
import org.eclipse.birt.report.engine.script.internal.element.Table;
import org.eclipse.birt.report.engine.script.internal.element.DynamicText;
import org.eclipse.birt.report.engine.script.internal.element.TextItem;
import org.eclipse.birt.report.engine.script.internal.instance.CellInstance;
import org.eclipse.birt.report.engine.script.internal.instance.DataItemInstance;
import org.eclipse.birt.report.engine.script.internal.instance.GridInstance;
import org.eclipse.birt.report.engine.script.internal.instance.ImageInstance;
import org.eclipse.birt.report.engine.script.internal.instance.LabelInstance;
import org.eclipse.birt.report.engine.script.internal.instance.ListInstance;
import org.eclipse.birt.report.engine.script.internal.instance.RowInstance;
import org.eclipse.birt.report.engine.script.internal.instance.TableInstance;
import org.eclipse.birt.report.engine.script.internal.instance.TextItemInstance;