Bug 208842 Issue of preview dataset including a computed column which refer to a report parameter[07]
Description: Issue of preview dataset including a computed column which refer to a report parameter[07] Build number: 2.3.0.v20071106-0800 Steps to reproduce: 1, New a string type report parameter with no default value 2, New a Dataset 3, New a computed column refer to report parameter(e.g params["p1"]) 4, Preview in dataset 5, Preview the report in layout and specify the value of parameter 6, Go back the dataset and preview the dataset Expected result: The computed column's value is the value specified when preview the report Actual result: Exception occurs when preview the dataset in step6 Error log: org.eclipse.birt.data.engine.core.DataException: An error happen during population of data. This might be caused by including data of mixed type in a column of "ANY" type. Invalid data type. at org.eclipse.birt.data.engine.impl.ComputedColumnHelperInstance.process(ComputedColumnHelper.java:412) at org.eclipse.birt.data.engine.impl.ComputedColumnHelper.process(ComputedColumnHelper.java:108) at org.eclipse.birt.data.engine.executor.cache.RowResultSet.processFetchEvent(RowResultSet.java:134) at org.eclipse.birt.data.engine.executor.cache.RowResultSet.next(RowResultSet.java:98) at org.eclipse.birt.data.engine.executor.cache.ExpandableRowResultSet.next(ExpandableRowResultSet.java:64) at org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper.populateData(SmartCacheHelper.java:299) at org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper.initInstance(SmartCacheHelper.java:271) at org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper.initOdaResult(SmartCacheHelper.java:155) at org.eclipse.birt.data.engine.executor.cache.SmartCacheHelper.getResultSetCache(SmartCacheHelper.java:79) at org.eclipse.birt.data.engine.executor.cache.SmartCache.<init>(SmartCache.java:56)
data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/script/DataAdapterTopLevelScope.java
* @param type
	 * @return true if should be converted
	 */
	private static boolean isToBeConverted( String type )
	{
		return type.equals( DesignChoiceConstants.PARAM_TYPE_STRING )
				|| type.equals( DesignChoiceConstants.PARAM_TYPE_DATETIME )
				|| type.equals( DesignChoiceConstants.PARAM_TYPE_TIME )
				|| type.equals( DesignChoiceConstants.PARAM_TYPE_DATE );
	}
	/**
	 * Delete the last "_" part
	 * 
	 * @param name
	 * @return String
	 */
	private static String prepareConfigVarName( String name )
	{
		int index = name.lastIndexOf( "_" ); 
		return name.substring( 0, index );
	}
	private static boolean isNullValue( String varName, String varValue,
			String newParaName )
	{
		return varName.toLowerCase( ).startsWith( "__isnull" )
				&& varValue.equals( newParaName );
	}
    	
}