当前位置: 首页>>代码示例>>Java>>正文


Java HTMLRenderOption.setImageHandler方法代码示例

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


在下文中一共展示了HTMLRenderOption.setImageHandler方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: HyperlinkEngineConfig

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
 * constructor
 */
public HyperlinkEngineConfig( )
{
	super( );

	HTMLRenderOption emitterConfig = (HTMLRenderOption) getEmitterConfigs( ).get( RenderOption.OUTPUT_FORMAT_HTML );

	emitterConfig.setImageHandler( new HTMLCompleteImageHandler( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:12,代码来源:StaticHTMLViewer.java

示例3: LauncherEngineConfig

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
/**
 * constructor
 */
public LauncherEngineConfig( )
{
	super( );

	HTMLRenderOption emitterConfig = (HTMLRenderOption) getEmitterConfigs( ).get( RenderOption.OUTPUT_FORMAT_HTML );

	emitterConfig.setImageHandler( new HTMLCompleteImageHandler( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:12,代码来源:ReportDocumentEditor.java

示例4: getReportEngine

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private synchronized IReportEngine getReportEngine()
{
	try
	{
		Level logLevel = LOGGER.isDebugEnabled() ? Level.FINE : Level.SEVERE;
		if( reportEngine == null )
		{
			LOGGER.info("Loading Birt engine");
			EngineConfig engineConfig = new EngineConfig();

			if( configService.isDebuggingMode() )
			{
				engineConfig.setOSGiConfig(ImmutableMap.of("osgi.dev", "true"));
			}
			URL resource = pluginService.getClassLoader("org.eclipse.birt.osgi").getResource("birt/");
			String birtHome = IoUtil.url2file(resource).getAbsolutePath();
			engineConfig.setBIRTHome(birtHome);

			HTMLRenderOption emitterConfig = new HTMLRenderOption();
			HTMLServerImageHandler imageHandler = new HTMLServerImageHandler();
			emitterConfig.setImageHandler(imageHandler);
			engineConfig.getEmitterConfigs().put("html", emitterConfig);

			// get log info from LOG4J
			java.util.logging.Logger birtLogger = java.util.logging.Logger.getLogger("org.eclipse.birt");
			if( birtLogger != null )
			{
				birtLogger.addHandler(new Log4JHandler());
			}

			// It was either use these extended classes or modify birt.
			Platform.startup(engineConfig);
			IReportEngineFactory factory = (IReportEngineFactory) Platform
				.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
			if( factory == null )
			{
				throw new BirtException("Could not get report engine factory");
			}
			reportEngine = factory.createReportEngine(engineConfig);
			reportEngine.changeLogLevel(logLevel);

		}
		return reportEngine;

	}
	catch( BirtException e )
	{
		Platform.shutdown();
		LOGGER.error("Error with Birt", e);
		throw new RuntimeApplicationException("Error loading reporting engine", e);
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:54,代码来源:ReportingServiceImpl.java

示例5: renderHtmlReport

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
@Override
public void renderHtmlReport(String reportName,
		Map<String, Object> parameters, OutputStream out, long pageNumber,
		boolean overwrite) throws BirtReportException {
	try {
		String reportFileName = absolutePathOf(reportFileName(reportName));
		String documentFileName = absoluteTempPath(
				documentFileName(reportName));

		recreateReportDocument(reportName, parameters, overwrite,
				reportFileName, documentFileName);

		IReportDocument reportDocument = reportEngine
				.openReportDocument(documentFileName);

		HTMLRenderOption htmlOptions = new HTMLRenderOption();
		htmlOptions.setOutputFormat(IRenderOption.OUTPUT_FORMAT_HTML);
		htmlOptions.setOutputStream(out);
		htmlOptions.setImageHandler(new HTMLServerImageHandler());
		htmlOptions.setEmbeddable(true);

		htmlOptions.setBaseImageURL(baseImageURL);
		htmlOptions.setImageDirectory(imageDirectory);

		htmlOptions.setHtmlPagination(true);
		htmlOptions.setMasterPageContent(false);
		htmlOptions.setPageFooterFloatFlag(true);

		IRenderTask renderTask = reportEngine
				.createRenderTask(reportDocument,
						reportDocument.getReportRunnable());
		renderTask.setRenderOption(htmlOptions);
		renderTask.setPageNumber(pageNumber);

		injectLocale(renderTask);

		renderTask.render();
		renderTask.close();

	} catch (EngineException | IOException e) {
		throw new BirtReportException(e);
	}
}
 
开发者ID:interseroh,项目名称:report-cockpit-birt-web,代码行数:44,代码来源:BirtReportServiceBean.java

示例6: renderHtmlReport

import org.eclipse.birt.report.engine.api.HTMLRenderOption; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void renderHtmlReport(String outputFile, String reportName)
		throws EngineException, FileNotFoundException {
	String file = this.getClass().getResource(reportName).getPath();
	IReportRunnable iReportRunnable = reportEngine.openReportDesign(file);

	IGetParameterDefinitionTask parameterDefinitionTask = reportEngine
			.createGetParameterDefinitionTask(iReportRunnable);
	IRunAndRenderTask runAndRenderTask = reportEngine
			.createRunAndRenderTask(iReportRunnable);
	Collection<IParameterDefnBase> parameterDefns = parameterDefinitionTask
			.getParameterDefns(true);
	for (IParameterDefnBase parameterDefn : parameterDefns) {
		System.out
				.println("Displayname: " + parameterDefn.getDisplayName());
		logger.info("Helptext: " + parameterDefn.getHelpText());
		logger.info("Name: " + parameterDefn.getName());
		logger.info("Typename: " + parameterDefn.getTypeName());
		logger.info("ParameterType: "
				+ BirtParameterType.valueOf(parameterDefn
						.getParameterType()));
		logger.info("PromptText: " + parameterDefn.getPromptText());
		logger.info("DefaultValue: "
				+ parameterDefinitionTask.getDefaultValue(parameterDefn));
		logger.info("Required: " + parameterDefn.getHandle());

		runAndRenderTask.setParameterValue(parameterDefn.getName(), 10101);
	}

	IRenderOption options = new RenderOption();

	HTMLRenderOption htmlOptions = new HTMLRenderOption(options);
	htmlOptions.setOutputFormat("html");
	htmlOptions.setOutputStream(new FileOutputStream(outputFile));
	htmlOptions.setImageHandler(new HTMLServerImageHandler());
	htmlOptions.setBaseImageURL("images");
	htmlOptions.setImageDirectory("target/images");
	runAndRenderTask.setRenderOption(htmlOptions);
	runAndRenderTask.run();
	runAndRenderTask.close();
}
 
开发者ID:interseroh,项目名称:report-cockpit-birt-web,代码行数:42,代码来源:BirtReportGenerateTest.java


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