errHtmlMsg.append( "Error" + ( i + 1 ) + ":" + context.getMsgLst( ).get( i ).toString( ) );
appendErrorMessage(index++, errHtmlMsg, (ElementExceptionInfo)it.next());
	public void execute( Report report, HashMap paramValues )	{		BirtTimer timer = new BirtTimer();		timer.start();				IReportContent reportContent = ContentFactory.createReportContent( report, null );		context.pushContentObject( reportContent );		context.setReport( report );		// Exceute scripts defined in included libraries. For each library,		// executes		// first the included scripts, then the initialize method.		// The current release does not supported externally included library		// files		// handle global libraries in the future		// execute scripts defined in include-script element of this report		// Parameters are not available at this stage		Iterator iter = report.getIncludeScripts( ).iterator( );		while ( iter.hasNext( ) )		{			String fileName = (String) iter.next( );			context.loadScript( fileName );		}				// DE needs to support getInitialize() method		// context.execute(report.getInitialize());		// call methods associated with report		context.execute( report.getBeforeFactory( ) );		// beforeRender is not supported for now		// Set up report parameters		setParameters( paramValues );		timer.stop();		timer.logTimeTaken(logger, Level.FINE, context.getTaskIDString(), "Prepare to run report");	// $NON-NLS-1$				// Prepare necessary data for this report		timer.restart();		context.getDataEngine( ).prepare( report );		timer.stop();		timer.logTimeTaken(logger, Level.FINE, context.getTaskIDString(), "Prepare report queries");	// $NON-NLS-1$				// Report documents are not supported for now		// context.execute(report.getBeforeOpenDoc());		timer.restart();		emitter.startReport( reportContent );		// report documents are not supported for now		// context.execute(report.getAfterOpenDoc());		// process page set up information		handlePageSetup( report );		context.pushMasterPage( context.getDefaultMasterPage( ) );		context.pushMasterPage( null );		// process the report body		emitter.startBody( );		//assert ( report.getContentCount( ) >= 1 );		// only top-level elements maybe have the master page reference for now		if ( report.getContentCount( ) > 0 )		{			for ( int i = 0; i < report.getContentCount( ); i++ )			{				builder.startPageFlow( report.getContent( i ).getStyle( )						.getMasterPage( ) );				report.getContent( i ).accept( builder );				builder.endPageFlow( );			}		}		else		{			builder.startPageFlow( null );			builder.endPageFlow( );		}		//Outputs the error message at the end of the report		if ( context.getMsgLst( ).size( ) > 0 )		{			TextItemDesign errText = new TextItemDesign( );			errText.setTextType( "html" );//$NON-NLS-1$			StringBuffer errHtmlMsg = new StringBuffer(					"<hr style=\"color:red\"/>" );//$NON-NLS-1$			errHtmlMsg					.append( "<pre style=\"color:red\">There are errors on the report page:" + (char) Character.LINE_SEPARATOR );//$NON-NLS-1$			for ( int i = 0; i < context.getMsgLst( ).size( ); i++ )			{				errHtmlMsg.append( "Error" + ( i + 1 )						+ ":" + context.getMsgLst( ).get( i ).toString( ) );//$NON-NLS-1$			}			errHtmlMsg.append("</pre>");			errText.setText( null, errHtmlMsg.toString( ) );			builder.startPageFlow( null );			errText.accept( builder );			builder.endPageFlow( );		}				//USED TO FIX BUG 74548		//FIXME: update the master page handle routines.		emitter.getPageSetupEmitter( ).endBody( );				emitter.endBody( );		context.popMasterPage( );		context.popMasterPage( );		// Report document is not supported		// context.execute(report.getBeforeCloseDoc());		emitter.endReport( );		// close eport document		// Report document is not supported		// context.execute(report.getAfterCloseDoc());		//call afterFactory method of the report		context.popContentObject( );		context.execute( report.getAfterFactory( ) );		context.getDataEngine( ).shutdown( );				timer.stop();		timer.logTimeTaken(logger, Level.FINE, context.getTaskIDString(), "Running and rendering report");	// $NON-NLS-1$	}