本文整理汇总了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);
}
示例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( ) );
}
示例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( ) );
}
示例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);
}
}
示例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);
}
}
示例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();
}