Report reportDesign = executionContext.getReport( );
	public void run( ) throws EngineException	{		setRunningFlag( true );		Report reportDesign = executionContext.getReport( );		// register default parameters and validate		if ( !validateParameters( ) )		{			setRunningFlag( false );			throw new EngineException(					MessageConstants.INVALID_PARAMETER_EXCEPTION ); //$NON-NLS-1$		}		loadDesign( );		prepareDesign( );		startFactory( );		startRender( );		try		{			IContentEmitter emitter = createContentEmitter( );			ReportExecutor executor = new ReportExecutor( executionContext,					reportDesign, null );			IReportExecutor lExecutor = new LocalizedReportExecutor(					executionContext, executor );			executionContext.setExecutor( executor );			initializeContentEmitter( emitter, executor );			// if we need do the paginate, do the paginate.			String format = executionContext.getOutputFormat( );			boolean paginate = true;			if ( "html".equalsIgnoreCase( format ) ) //$NON-NLS-1$			{				if ( renderOptions instanceof HTMLRenderOption )				{					HTMLRenderOption htmlOption = (HTMLRenderOption) renderOptions;					paginate = htmlOption.getHtmlPagination( );				}			}			synchronized ( this )			{				if ( !executionContext.isCanceled( ) )				{					layoutEngine = LayoutEngineFactory.createLayoutEngine( emitter.getOutputFormat( ) );				}			}						if( layoutEngine != null )			{				OnPageBreakLayoutPageHandle handle = new OnPageBreakLayoutPageHandle(						executionContext );				layoutEngine.setPageHandler( handle );				CompositeContentEmitter outputEmitters = new CompositeContentEmitter( format);				outputEmitters.addEmitter( emitter );				outputEmitters.addEmitter( handle.getEmitter( ) );				layoutEngine.layout( lExecutor, outputEmitters, paginate );			}			closeRender( );			closeFactory( );		}		catch ( EngineException e )		{			throw e;		}		catch ( Exception ex )		{			ex.printStackTrace( );			log.log( Level.SEVERE,					"An error happened while running the report. Cause:", ex ); //$NON-NLS-1$			throw new EngineException(					"Error happened while running the report", ex ); //$NON-NLS-1$		}		catch ( OutOfMemoryError err )		{			err.printStackTrace( );			log.log( Level.SEVERE,					"An OutOfMemory error happened while running the report." ); //$NON-NLS-1$			throw err;		}		catch ( Throwable t )		{			log.log( Level.SEVERE,					"Error happened while running the report.", t ); //$NON-NLS-1$			new EngineException( "Error happened while running the report", t ); //$NON-NLS-1$		}		finally		{			setRunningFlag( false );		}	}