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/executor/GridItemExecutor.java
import org.eclipse.birt.data.engine.api.IBaseQueryDefinition;
import org.eclipse.birt.data.engine.api.IResultIterator;
import org.eclipse.birt.report.engine.api.script.IRowData;
import org.eclipse.birt.report.engine.content.ICellContent;
import org.eclipse.birt.report.engine.content.IContent;
import org.eclipse.birt.report.engine.content.IRowContent;
import org.eclipse.birt.report.engine.content.ITableBandContent;
import org.eclipse.birt.report.engine.content.ITableContent;
import org.eclipse.birt.report.engine.content.impl.TableContent;
import org.eclipse.birt.report.engine.content.impl.RowContent;
import org.eclipse.birt.report.engine.content.impl.CellContent;
import org.eclipse.birt.report.engine.content.impl.Column;
import org.eclipse.birt.report.engine.data.dte.DteResultSet;
import org.eclipse.birt.report.engine.emitter.IContentEmitter;
import org.eclipse.birt.report.engine.ir.CellDesign;
import org.eclipse.birt.report.engine.ir.ColumnDesign;
import org.eclipse.birt.report.engine.ir.GridItemDesign;
import org.eclipse.birt.report.engine.ir.IReportItemVisitor;
import org.eclipse.birt.report.engine.ir.ReportItemDesign;
import org.eclipse.birt.report.engine.ir.RowDesign;
import org.eclipse.birt.report.engine.script.internal.CellScriptExecutor;
import org.eclipse.birt.report.engine.script.internal.GridScriptExecutor;
import org.eclipse.birt.report.engine.script.internal.RowData;
import org.eclipse.birt.report.engine.script.internal.RowScriptExecutor;
/**
 * the gridItem excutor
 * 
 * @version $Revision: 1.26 $ $Date: 2005/12/16 03:58:38 $
 */
public class GridItemExecutor extends QueryItemExecutor