• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java HTMLRenderOption类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.birt.report.engine.api.HTMLRenderOption的典型用法代码示例。如果您正苦于以下问题:Java HTMLRenderOption类的具体用法?Java HTMLRenderOption怎么用?Java HTMLRenderOption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HTMLRenderOption类属于org.eclipse.birt.report.engine.api包,在下文中一共展示了HTMLRenderOption类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testGetRenderOption

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
/**
 * Test setRenderOption(IRenderOption) method Test getRenderOption() method
 */

public void testGetRenderOption( )
{
	RenderOptionBase rendop = new RenderOptionBase( );
	rendop.setOutputFormat( "fo" );
	rendop.setOutputFileName( "outputfile" );

	HTMLRenderContext context = new HTMLRenderContext( );
	context.setRenderOption( rendop );

	RenderOptionBase ropb = (RenderOptionBase) ( context.getRenderOption( ) );

	assertEquals( "fo", ropb.getOutputFormat( ) );
	Map outsetting = new HashMap( );
	outsetting = ropb.getOutputSetting( );

	assertFalse( outsetting.isEmpty( ) );
	assertEquals( 2, outsetting.size( ) );

	ropb.getOutputSetting( ).put( HTMLRenderOption.URL_ENCODING, "UTF-8" );
	assertEquals( 3, outsetting.size( ) );

}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:HTMLRenderContextTest.java


示例2: runandrender_emitter

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
/**
 * @param format
 *            render format
 * @param pagination
 *            For html output only, decide whether generate report with page
 *            break or not.
 * @throws EngineException
 */
protected ArrayList runandrender_emitter( String format, boolean pagination )
		throws EngineException
{
	IReportRunnable reportRunnable = engine.openReportDesign( inPath
			+ getReportName( ) );
	IRunAndRenderTask task = engine.createRunAndRenderTask( reportRunnable );
	RenderOption options = new HTMLRenderOption( );
	options.setOutputFormat( format );
	if ( format.equals( EMITTER_HTML ) )
	{
		( (HTMLRenderOption) options ).setHtmlPagination( pagination );
	}
	HashMap appContext = new HashMap( );
	appContext.put( "emitter_class", this );
	task.setAppContext( appContext );
	task.setRenderOption( options );
	task.run( );
	ArrayList errors = (ArrayList) task.getErrors( );
	task.close( );
	return errors;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:30,代码来源:BaseEmitter.java


示例3: runandthenrender_emitter

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
protected ArrayList runandthenrender_emitter( String format )
		throws EngineException
{
	ArrayList errors = new ArrayList( );
	this.run( getReportName( ) + ".rptdesign", getReportName( )
			+ ".rptdocument" );
	IReportDocument document = engine.openReportDocument( outPath
			+ getReportName( ) + ".rptdocument" );
	IRenderTask task = engine.createRenderTask( document );
	RenderOption options = new HTMLRenderOption( );
	options.setOutputFormat( format );
	HashMap appContext = new HashMap( );
	appContext.put( "emitter_class", this );
	task.setAppContext( appContext );
	task.setRenderOption( options );
	task.render( );
	errors = (ArrayList) task.getErrors( );
	task.close( );
	return errors;

}
 
开发者ID:eclipse,项目名称:birt,代码行数:22,代码来源:BaseEmitter.java


示例4: testVisionOptimize

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
public void testVisionOptimize( ) throws EngineException, IOException
{
	HTMLRenderOption options = new HTMLRenderOption( );
	options.setOutputMasterPageMargins( true );
	options.setEmbeddable( false );
	
	ByteArrayOutputStream output = new ByteArrayOutputStream( );
	List instanceIDs = new ArrayList( );
	options.setInstanceIDs( instanceIDs );
	options.setOutputStream( output );
	options.setEnableMetadata( true );
	IRenderTask task = createRenderTask( designFile );
	task.setRenderOption( options );
	task.render( );
	task.close( );
	String content = new String( output.toByteArray( ) );
	output.close( );
	
	String regex = "<col style=\"width: 1.25in;\">";
	Matcher matcher = Pattern.compile( regex ).matcher( content );
	assertEquals( true, matcher.find( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:HTMLMastePageMarginsTest.java


示例5: testInlineStyle

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
public void testInlineStyle( ) throws EngineException, IOException
{
	HTMLRenderOption options = new HTMLRenderOption( );
	options.setEmbeddable( true );
	options.setEnableInlineStyle( true );
	
	ByteArrayOutputStream output = new ByteArrayOutputStream( );
	List instanceIDs = new ArrayList( );
	options.setInstanceIDs( instanceIDs );
	options.setOutputStream( output );
	IRenderTask task = createRenderTask( designFile );
	task.setRenderOption( options );
	task.render( );
	task.close( );
	String content = new String( output.toByteArray( ) );
	output.close( );
	
	String regex = "<style type=\"text/css\">";
	Matcher matcher = Pattern.compile( regex ).matcher( content );
	assertEquals( false, matcher.find( ) );
	
	regex = "<div[^<>]*style=\"[^<>]*color: rgb(255, 0, 0)[^<>]*>aaaa</div>";
	matcher = Pattern.compile( regex ).matcher( content );
	assertEquals( false, matcher.find( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:26,代码来源:StyleTest.java


示例6: testTableColumnWidth

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
/**
 * 
 * @throws EngineException
 * @throws IOException
 */
public void testTableColumnWidth( ) throws EngineException, IOException
{
	//the default cell to place the group icon is the first cell.
	String designFile = "org/eclipse/birt/report/engine/emitter/html/TableColumnWidth.xml";
	HTMLRenderOption options = new HTMLRenderOption( );
	options.setLayoutPreference( "fixed" );
	
	ByteArrayOutputStream output = new ByteArrayOutputStream( );
	List instanceIDs = new ArrayList( );
	options.setInstanceIDs( instanceIDs );
	options.setOutputStream( output );
	options.setEnableMetadata( true );
	IRenderTask task = createRenderTask( designFile );
	task.setRenderOption( options );
	task.render( );
	task.close( );
	String content = new String( output.toByteArray( ) );
	output.close( );
	
	content = content.replaceAll( "\n", "\"\n\"+\\\\n" );
	String regex = "table-layout:fixed";
	Matcher matcher = Pattern.compile( regex ).matcher( content );
	assertEquals( true, matcher.find( ) );

}
 
开发者ID:eclipse,项目名称:birt,代码行数:31,代码来源:TableLayoutTest.java


示例7: testDisplayGroupIconWithGroupKey

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
/**
 * Test group icon will be displayed with group key even when the key is in a grid without query.
 * @throws EngineException
 * @throws IOException
 */
public void testDisplayGroupIconWithGroupKey( ) throws EngineException, IOException
{
	String designFile = "org/eclipse/birt/report/engine/emitter/html/displayGroupIcon_Test1.xml";

	//a. Test run and render task.
	HTMLRenderOption options = new HTMLRenderOption( );
	options.setDisplayGroupIcon( true );
	String[] iconKeys = {"group key1 in data item",
			"group key2 in grid without query", "group key3 in data item",
			"group key4 with same expression"};
	String content = getRenderResult( designFile, false, options ).content;
	checkAllGroupIconDisplayed( options, content, iconKeys );

	content = getRenderResult( designFile, true, options ).content;
	checkAllGroupIconDisplayed( options, content, iconKeys );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:22,代码来源:MetadataEmitterTest.java


示例8: testPerformanceOptimize

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
public void testPerformanceOptimize( ) throws EngineException, IOException
{
	HTMLRenderOption options = new HTMLRenderOption( );
	options.setEnableAgentStyleEngine( true );
	options.setEmbeddable( true );
	
	ByteArrayOutputStream output = new ByteArrayOutputStream( );
	List instanceIDs = new ArrayList( );
	options.setInstanceIDs( instanceIDs );
	options.setOutputStream( output );
	//options.setEnableMetadata( true );
	IRenderTask task = createRenderTask( designFile );
	task.setRenderOption( options );
	task.render( );
	task.close( );
	String content = new String( output.toByteArray( ) );
	output.close( );
	
	String regex = "text-decoration: underline;";
	Matcher matcher = Pattern.compile( regex ).matcher( content );
	assertEquals( true, matcher.find( ) );
	
	regex = "<div style=\" text-decoration: underline;\">";
	matcher = Pattern.compile( regex ).matcher( content );
	assertEquals( false, matcher.find( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:HTMLEmitterOptimizeTest.java


示例9: testVisionOptimize

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
public void testVisionOptimize( ) throws EngineException, IOException
{
	HTMLRenderOption options = new HTMLRenderOption( );
	options.setEnableAgentStyleEngine( false );
	options.setEmbeddable( true );
	
	ByteArrayOutputStream output = new ByteArrayOutputStream( );
	List instanceIDs = new ArrayList( );
	options.setInstanceIDs( instanceIDs );
	options.setOutputStream( output );
	//options.setEnableMetadata( true );
	IRenderTask task = createRenderTask( designFile );
	task.setRenderOption( options );
	task.render( );
	task.close( );
	String content = new String( output.toByteArray( ) );
	output.close( );
	
	String regex = "<div style=\" text-decoration: underline;";
	Matcher matcher = Pattern.compile( regex ).matcher( content );
	assertEquals( true, matcher.find( ) );

}
 
开发者ID:eclipse,项目名称:birt,代码行数:24,代码来源:HTMLEmitterOptimizeTest.java


示例10: getReportTitle

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
protected String getReportTitle( IReportContent report )
{
	// write the title of the report in HTML.
	String title = null;
	if ( report != null )
	{
		title = report.getTitle( );
	}
	if ( title == null )
	{
		// set the default title
		if ( renderOption != null )
		{
			HTMLRenderOption htmlOption = new HTMLRenderOption( renderOption );
			title = htmlOption.getHtmlTitle( );
		}
	}
	return title;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:20,代码来源:HTMLReportEmitter.java


示例11: retrieveRtLFlag

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
/**
 * Figures out the RTL rendering option.
 *
 * @param htmlOption
 * @author bidi_hcg
 */
private void retrieveRtLFlag( )
{
	// If htmlOption has RTL_FLAG option set (likely adopted from an URL
	// parameter), honor this option, otherwise obtain direction from
	// the report design.
	HTMLRenderOption htmlOption = new HTMLRenderOption( renderOption );
	Object bidiFlag = htmlOption.getOption( IRenderOption.RTL_FLAG );
	if ( Boolean.TRUE.equals( bidiFlag ) )
	{
		htmlRtLFlag = true;
	}
	else if ( bidiFlag == null && report != null)
	{
		ReportDesignHandle handle = report.getDesign( ).getReportDesign( );
		if ( handle != null )
		{
			htmlRtLFlag = handle.isDirectionRTL( );
			htmlOption.setHtmlRtLFlag( htmlRtLFlag ); // not necessary though
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:28,代码来源:HTMLReportEmitter.java


示例12: runAndRender

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
/**
 * Run and render the report, and return the render result.
 * 
 * @param designFile
 * @return render result.
 * @throws EngineException
 * @throws IOException
 */
protected String runAndRender( String designFile ) throws EngineException,
		IOException
{
	IRunAndRenderTask runAndRenderTask = createRunAndRenderTask( designFile );
	HTMLRenderOption options = new HTMLRenderOption( );
	ByteArrayOutputStream out = new ByteArrayOutputStream( );
	options.setOutputStream( out );
	options.setOutputFormat( "html" );
	options.setHtmlPagination( true );
	runAndRenderTask.setRenderOption( options );
	runAndRenderTask.run( );
	runAndRenderTask.close( );
	String result = new String( out.toByteArray( ) );
	out.close( );
	return result;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:25,代码来源:EngineCase.java


示例13: renderPage

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
protected String renderPage( IReportDocument doc, long pageNo )
		throws Exception
{
	ByteArrayOutputStream buffer = new ByteArrayOutputStream( );
	assertTrue( pageNo <= doc.getPageCount( ) );
	IRenderTask renderTask = engine.createRenderTask( doc );
	try
	{
		HTMLRenderOption options = new HTMLRenderOption( );
		options.setOutputFormat( "html" );
		options.setOutputStream( buffer );
		renderTask.setRenderOption( options );
		renderTask.setPageNumber( (long) pageNo );
		renderTask.render( );
		List errors = renderTask.getErrors( );
		assertEquals( 0, errors.size( ) );
	}
	finally
	{
		renderTask.close( );
	}
	return new String( buffer.toString( "UTF-8" ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:24,代码来源:IVViewTest.java


示例14: run

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
public void run( ) throws Exception
{
	// render the generated report document
	IReportDocument doc = engine.openReportDocument( fileName );
	long pageCount = doc.getPageCount( );
	for ( int i = 1; i <= pageCount; i++ )
	{
		IRenderTask renderTask = engine.createRenderTask( doc );

		HTMLRenderOption option = new HTMLRenderOption( );
		option.setOutputFormat( "html" );
		option.setOutputStream( new ByteArrayOutputStream( ) );
		renderTask.setRenderOption( option );
		renderTask.setPageNumber( i );

		renderTask.render( );
		List errors = renderTask.getErrors( );
		assertEquals( 0, errors.size( ) );
		renderTask.close( );
	}
	doc.close( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:IVTest.java


示例15: doRenderAll

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
void doRenderAll( ) throws Exception
{
	IReportDocument document = engine.openReportDocument( REPORT_DOCUMENT );
	ByteArrayOutputStream out = new ByteArrayOutputStream( );
	IRenderTask renderTask = engine.createRenderTask( document );
	renderTask.getReportRunnable( ).setDesignHandle( reportHandle );
	IRenderOption option = new HTMLRenderOption( );
	option.setOutputFormat( HTMLRenderOption.OUTPUT_FORMAT_HTML );
	option.setOutputStream( out );
	renderTask.setRenderOption( option );
	renderTask.render( );
	assertTrue( renderTask.getErrors( ).isEmpty( ) );
	renderTask.close( );
	String pageContent = out.toString( "UTF-8" );
	assertTrue( pageContent.indexOf( "reportlet_table" ) != -1 );
	assertTrue( pageContent.indexOf( "SECOND-PAGE" ) != -1 );
	document.close( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:DocumentIRTransferTest.java


示例16: doRenderAll

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
void doRenderAll( ) throws Exception
{
	IReportDocument document = engine.openReportDocument( REPORT_DOCUMENT );
	ByteArrayOutputStream out = new ByteArrayOutputStream( );
	IRenderTask renderTask = engine.createRenderTask( document );
	IRenderOption option = new HTMLRenderOption( );
	option.setOutputFormat( HTMLRenderOption.OUTPUT_FORMAT_HTML );
	option.setOutputStream( out );
	renderTask.setRenderOption( option );
	renderTask.render( );
	assertTrue( renderTask.getErrors( ).isEmpty( ) );
	renderTask.close( );
	String pageContent = out.toString( "UTF-8" );
	assertTrue( pageContent.indexOf( "reportlet_table" ) != -1 );
	assertTrue( pageContent.indexOf( "SECOND-PAGE" ) != -1 );
	document.close( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:ReportDocumentTest.java


示例17: test90378

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
public void test90378( ) throws Exception
{
	ByteArrayOutputStream out = new ByteArrayOutputStream( );
	IRenderOption option = new HTMLRenderOption( );
	option.setOutputFormat( "html" );
	option.setOutputStream( out );
	render( "org/eclipse/birt/report/engine/regression/90378.rptdesign",
			option );
	String report = out.toString( );

	Pattern pattern = Pattern.compile( "<div>b1</div>" );
	Matcher matcher = pattern.matcher( report );
	int matches = 0;
	while ( matcher.find( ) )
	{
		matches++;
	}
	assertEquals( 2, matches );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:20,代码来源:Test_90378.java


示例18: configEngine

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
protected void configEngine( )
{
	HTMLRenderOption emitterConfig = new HTMLRenderOption( );

	emitterConfig.setActionHandler( new HTMLActionHandler( ) {

		public String getURL( IAction actionDefn, Object context )
		{
			if ( actionDefn.getType( ) == IAction.ACTION_DRILLTHROUGH )
				return "birt://" //$NON-NLS-1$
						+ URLEncoder.encode( super.getURL( actionDefn,
								context ) );
			return super.getURL( actionDefn, context );
		}

	} );
	// emitterConfig.setImageHandler( new HTMLCompleteImageHandler( ) );
	// emitterConfig.setImageHandler( new HTMLImageHandler( ) );
	engineConfig.getEmitterConfigs( ).put( RenderOption.OUTPUT_FORMAT_HTML,
			emitterConfig );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:22,代码来源:StaticHTMLViewer.java


示例19: configEngine

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
private void configEngine( )
{
	HTMLRenderOption emitterConfig = new HTMLRenderOption( );

	emitterConfig.setActionHandler( new HTMLActionHandler( ) {

		public String getURL( IAction actionDefn, Object context )
		{
			if ( actionDefn.getType( ) == IAction.ACTION_DRILLTHROUGH )
				return "birt://" //$NON-NLS-1$
						+ URLEncoder.encode( super.getURL( actionDefn,
								context ) );
			return super.getURL( actionDefn, context );
		}

	} );

	engineConfig.getEmitterConfigs( ).put( RenderOption.OUTPUT_FORMAT_HTML,
			emitterConfig );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:ReportDocumentEditor.java


示例20: startBirtEngine

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static synchronized void startBirtEngine(IPlatformContext context)
{				
	log.info("Starting BIRT Engine and OSGI Platform using: " + context.getClass().getName());		
			
	HTMLServerImageHandler imageHandler = new HTMLServerImageHandler();
	
	HTMLRenderOption emitterConfig = new HTMLRenderOption();
	emitterConfig.setActionHandler(new HTMLActionHandler());		
	emitterConfig.setImageHandler(imageHandler);

	EngineConfig config = new EngineConfig();
	config.setEngineHome("");
	config.setPlatformContext(context);								
	config.setLogConfig(null, Level.ALL);			
	config.getEmitterConfigs().put("html", emitterConfig);

	try
	{
		Platform.startup(config);
	}
	catch (BirtException e)
	{
		log.error("BirtException", e);
	}

	IReportEngineFactory factory = (IReportEngineFactory) Platform
			.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
	
	birtEngine = factory.createReportEngine(config);
	
	log.info("BIRT Engine Started");
		
	birtEngine.changeLogLevel(Level.SEVERE);	
}
 
开发者ID:mtpettyp,项目名称:openreports,代码行数:36,代码来源:BirtProvider.java



注:本文中的org.eclipse.birt.report.engine.api.HTMLRenderOption类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Emote类代码示例发布时间:2022-05-22
下一篇:
Java DefaultDomain类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap