assertTrue( "Render reportlet-" + docName + " to html failed. ", new File(outputFileName).exists( ) );  outputFileName = outputPath + docName + "/pdf/" + type + ".pdf";
assertEquals( "Exception when render reportlet-" + docName + " to html.", 0, task.getErrors( ).size( ) ); assertTrue( "Render reportlet-" + docName + " to html failed. ", new File( outputFileName ).exists( ) );  outputFileName = outputPath + docName + "/pdf/" + type + ".pdf";
	protected void renderReportlet( String docName, InstanceID iid, String type )	{		if ( iid == null )		{			assertFalse( "Failed to find instance id of " + type, true );		}		else		{			report_document = inputPath + docName + ".rptdocument";			IRenderTask task;			// create directories to deposit output files			createDir( docName );			try			{				reportDoc = engine.openReportDocument( report_document );				task = engine.createRenderTask( reportDoc );				IRenderOption htmlRenderOptions = new HTMLRenderOption( );				HTMLRenderContext renderContext = new HTMLRenderContext( );				renderContext.setImageDirectory( "image" );				HashMap appContext = new HashMap( );				appContext.put( EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT,						renderContext );				task.setAppContext( appContext );				outputFileName = outputPath + docName + "/html/" + type						+ ".html";				htmlRenderOptions.setOutputFileName( outputFileName );				htmlRenderOptions.setOutputFormat( "html" );				task.setRenderOption( htmlRenderOptions );				task.setInstanceID( iid );				task.render( );				assertTrue( "Render reportlet-" + docName + " to html failed. ",						new File(outputFileName).exists( ) );								outputFileName = outputPath + docName + "/pdf/" + type				+ ".pdf";				htmlRenderOptions.setOutputFileName( outputFileName );				htmlRenderOptions.setOutputFormat( "pdf" );				task.setRenderOption( htmlRenderOptions );				task.setInstanceID( iid );				task.render( );				task.close( );				assertTrue( "Render reportlet-" + docName + " to pdf failed. ",						new File(outputFileName).exists( ) );			}			catch ( Exception e )			{				e.printStackTrace( );				assertTrue( "Render reportlet " + type + "from" + docName						+ " failed. " + e.getLocalizedMessage( ), false );			}		}	}