Bug 131011 Support running query based on report document data
Data Engine should support running a query based on data set and expression data stored in a report document. This bugzilla entry serves as a repository for design docs and notes related to this feature.
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/document/RDGroupUtil.java
{
		if ( cacheProvider == null )
			throw new DataException( ResourceConstants.NO_CURRENT_ROW );
	}
	private void checkHasCurrentRow( ) throws DataException
	{
		checkStarted( );
		if ( cacheProvider.getCurrentIndex( ) >= cacheProvider.getCount( ) )
			throw new DataException( ResourceConstants.NO_CURRENT_ROW );
	}
	/**
	 * Returns the 1-based index of the outermost group
	 * in which the current row is the last row. 
	 * For example, if a query contain N groups 
	 * (group with index 1 being the outermost group, and group with 
	 * index N being the innermost group),
	 * and this function returns a value M, it indicates that the 
	 * current row is the last row in groups with 
	 * indexes (M, M+1, ..., N ). 
	 * @return	The 1-based index of the outermost group in which 
	 * 			the current row is the last row;
	 * 			(N+1) if the current row is not at the end of any group;
	 */
	int getEndingGroupLevel( ) throws DataException
	{
		checkHasCurrentRow( );
		
		if ( cacheProvider.getCurrentIndex( ) == cacheProvider.getCount( ) - 1 )
			return 0;