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

Java RenderOption类代码示例

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

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



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

示例1: toPPTX

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
protected void toPPTX( IReportEngine engine, String reportDocument,
		String pptx ) throws EngineException
{
	IReportDocument document = engine.openReportDocument( reportDocument );
	try
	{
		IRenderTask task = engine.createRenderTask( document );
		try
		{
			RenderOption option = new RenderOption( );
			option.setOutputFormat( "pptx" );
			option.setOutputFileName( pptx );
			task.setRenderOption( option );
			task.render( );;
		}
		finally
		{
			task.close( );
		}
	}
	finally
	{
		document.close( );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:26,代码来源:DesignToPNG.java


示例2: buildRenderOptions

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
@Override
protected RenderOption buildRenderOptions(HttpServletRequest request, HttpServletResponse response) throws IOException {
    RenderOption opts = new PDFRenderOption();
    opts.setOutputFormat("PDF");
    opts.setOutputStream(response.getOutputStream());
    return opts;
}
 
开发者ID:kewne,项目名称:spring-birt,代码行数:8,代码来源:PdfBirtReportView.java


示例3: runandrender_emitter

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的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


示例4: runandthenrender_emitter

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的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


示例5: getPreferredRenderOption

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
@Override
public IRenderOption getPreferredRenderOption( )
{
	RenderOption renderOption = new RenderOption( );

	renderOption.setEmitterID( getID( ) );
	renderOption.setOutputFormat( "postscript" ); //$NON-NLS-1$

	if ( values != null && values.length > 0 )
	{
		for ( IOptionValue optionValue : values )
		{
			if ( optionValue != null )
			{
				renderOption.setOption(
						getRenderOptionName( optionValue.getName( ) ),
						optionValue.getValue( ) );
			}
		}
	}

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


示例6: initialize

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
/**
 * Initializes the pdfEmitter.
 * 
 * @param services
 *            the emitter svervices object.
 * @throws EngineException 
 */
private void initialize( IEmitterServices services ) throws EngineException
{
	this.services = services;
	renderOption = (RenderOption)services.getRenderOption( );
	// Gets the output file name from RenderOptionBase.OUTPUT_FILE_NAME.
	// It has the top preference.
	IReportRunnable reportRunnable = services.getReportRunnable( );
	if ( reportRunnable != null )
	{
		reportDesign = (ReportDesignHandle) reportRunnable
				.getDesignHandle( );
	}

	this.context = services.getReportContext( );
	this.output = EmitterUtil.getOuputStream( services, "report.ps" );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:24,代码来源:PostscriptRender.java


示例7: getPreferredRenderOption

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
@Override
public IRenderOption getPreferredRenderOption( )
{
	RenderOption renderOption = new RenderOption( );

	renderOption.setEmitterID( getID( ) );
	renderOption.setOutputFormat( "docx" ); //$NON-NLS-1$

	if ( values != null && values.length > 0 )
	{
		for ( IOptionValue optionValue : values )
		{
			if ( optionValue != null )
			{
				renderOption.setOption(
						getRenderOptionName( optionValue.getName( ) ),
						optionValue.getValue( ) );
			}
		}
	}

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


示例8: getPreferredRenderOption

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
@Override
public IRenderOption getPreferredRenderOption( )
{
	RenderOption renderOption = new RenderOption( );

	renderOption.setEmitterID( getID( ) );
	renderOption.setOutputFormat( "odt" ); //$NON-NLS-1$

	if ( values != null && values.length > 0 )
	{
		for ( IOptionValue optionValue : values )
		{
			if ( optionValue != null )
			{
				renderOption.setOption(
						getRenderOptionName( optionValue.getName( ) ),
						optionValue.getValue( ) );
			}
		}
	}

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


示例9: getPreferredRenderOption

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
@Override
public IRenderOption getPreferredRenderOption( )
{
	RenderOption renderOption = new RenderOption( );

	renderOption.setEmitterID( getID( ) );
	renderOption.setOutputFormat( "doc" ); //$NON-NLS-1$

	if ( values != null && values.length > 0 )
	{
		for ( IOptionValue optionValue : values )
		{
			if ( optionValue != null )
			{
				renderOption.setOption(
						getRenderOptionName( optionValue.getName( ) ),
						optionValue.getValue( ) );
			}
		}
	}

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


示例10: configEngine

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的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


示例11: configEngine

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的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


示例12: buildRenderOptions

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
@Override
protected RenderOption buildRenderOptions(HttpServletRequest request, HttpServletResponse response) throws IOException {
    HTMLRenderOption opt = new HTMLRenderOption();
    opt.setEmitterID("io.github.kewne.spring_birt.htmlPlusEmbeddedSvg");
    opt.setOutputFormat(HTMLRenderOption.HTML);
    opt.setOutputStream(response.getOutputStream());
    opt.setBaseImageURL(null);
    opt.setImageDirectory(null);
    opt.setEnableAgentStyleEngine(true);
    return opt;
}
 
开发者ID:kewne,项目名称:spring-birt,代码行数:12,代码来源:HtmlBirtReportView.java


示例13: renderMergedOutputModel

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
@Override
protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
    InputStream reportPath = null;
    try {
        reportPath = getServletContext()
                .getResourceAsStream(getUrl());
        if (reportPath == null) {
            reportPath = new ClassPathResource(getUrl()).getInputStream();
        }
        IReportRunnable report = reportEngine.openReportDesign(getUrl(), reportPath);
        IRunAndRenderTask task = reportEngine.createRunAndRenderTask(report);

        task.setLocale(request.getLocale());
        for (Map.Entry<String, Object> e : model.entrySet()) {
            task.setParameterValue(e.getKey(), e.getValue());
        }
        RenderOption opts = buildRenderOptions(request, response);
        response.setContentType(getContentType());
        response.setCharacterEncoding(StandardCharsets.UTF_8.name());
        task.setRenderOption(opts);

        task.run();
        task.close();
    } finally {
        if (reportPath != null) {
            reportPath.close();
        }
    }

}
 
开发者ID:kewne,项目名称:spring-birt,代码行数:31,代码来源:AbstractBirtReportView.java


示例14: buildRenderOptions

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
@Override
protected RenderOption buildRenderOptions(HttpServletRequest request, HttpServletResponse response) throws IOException {
    EXCELRenderOption opt = new EXCELRenderOption();
    opt.setOutputFormat("xlsx");
    opt.setOutputStream(response.getOutputStream());
    return opt;
}
 
开发者ID:kewne,项目名称:spring-birt,代码行数:8,代码来源:XlsBirtReportView.java


示例15: PostscriptPageDevice

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
public PostscriptPageDevice( RenderOption renderOption, OutputStream output, String title,
		String author, String description ) throws Exception
{
	BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(
			output );
	writer = new PostscriptWriter( bufferedOutputStream, title );
	
	String paperSize = renderOption
			.getStringOption( PostscriptRenderOption.OPTION_PAPER_SIZE );
	String paperTray = renderOption
	        .getStringOption( PostscriptRenderOption.OPTION_PAPER_TRAY );
	Object duplex = renderOption
	        .getOption( PostscriptRenderOption.OPTION_DUPLEX );
	int copies = renderOption.getIntOption(
			PostscriptRenderOption.OPTION_COPIES, 1 );
	boolean collate = renderOption.getBooleanOption(
			PostscriptRenderOption.OPTION_COLLATE, false );
	String resolution = renderOption
			.getStringOption( IPostscriptRenderOption.OPTION_RESOLUTION );
	boolean color = renderOption.getBooleanOption(
			IPostscriptRenderOption.OPTION_COLOR, true );
	int scale = renderOption
			.getIntOption( IPostscriptRenderOption.OPTION_SCALE, 100 );
	boolean autoPaperSizeSelection = renderOption
	        .getBooleanOption( IPostscriptRenderOption.OPTION_AUTO_PAPER_SIZE_SELECTION,
	                           false );
	boolean fitToPaper = renderOption
	        .getBooleanOption( IPostscriptRenderOption.OPTION_FIT_TO_PAPER,
	                           false );
	writer.startRenderer( author, description, paperSize, paperTray,
	                      duplex, copies, collate, resolution, color,
	                      scale, autoPaperSizeSelection, fitToPaper );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:34,代码来源:PostscriptPageDevice.java


示例16: getCompressionMode

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
private CompressionMode getCompressionMode( RenderOption renderOption )
{
	CompressionMode compressionMode = CompressionMode.BEST_COMPRESSION;
	Object mode = renderOption.getOption( DocxRenderOption.OPTION_COMPRESSION_MODE );
	if ( mode instanceof CompressionMode )
	{
		compressionMode = (CompressionMode) mode;
	}
	return compressionMode;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:11,代码来源:PPTXRender.java


示例17: initialize

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
/**
 * Initializes the PPTEmitter.
 * 
 * @param services
 *            the emitter services object.
 * @throws BirtException
 */
public void initialize( IEmitterServices services )
{
	this.services = services;
	renderOption = (RenderOption) services.getRenderOption( );
	reportRunnable = services.getReportRunnable( );

	if ( reportRunnable != null )
	{
		reportDesign = (ReportDesignHandle) reportRunnable.getDesignHandle( );
		isRTL = reportDesign.isDirectionRTL( );
	}
	this.context = services.getReportContext( );
	this.editMode = renderOption.getBooleanOption( OPTION_EDIT_MODE, true );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:22,代码来源:PPTXRender.java


示例18: initialize

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
public void initialize( IEmitterServices service ) throws EngineException
{
	this.service = service;

	this.context = createContext();
	if ( service != null )
	{
		this.reportRunnable = service.getReportRunnable( );
		this.actionHandler = (IHTMLActionHandler) service.getOption( RenderOption.ACTION_HANDLER );
		
		String tempFileDir = service.getReportEngine( ).getConfig( ).getTempDir( );				
		context.setTempFileDir( service.getReportEngine( ).getConfig( )
				.getTempDir( ) );

		// TODO: use temp file for document body
		this.bodyOut = new ByteArrayOutputStream();
		this.masterPageOut = new ByteArrayOutputStream();
		
		this.out = EmitterUtil.getOuputStream( service, "report." //$NON-NLS-1$
				+ getOutputFormat( ) );
		pkg = Package.createInstance( out, tempFileDir, getRootMime() );
		context.setPackage( pkg );
		this.reportContext = service.getReportContext( );
	}
	
	ULocale locale = null;
	if ( reportContext != null )
	{
		locale = ULocale.forLocale( reportContext.getLocale( ) );
	}
	if ( locale == null )
	{
		locale = ULocale.getDefault( );
	}
	context.setLocale( locale );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:37,代码来源:AbstractOdfEmitter.java


示例19: getHyperlink

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
public static HyperlinkInfo getHyperlink( IArea area,
		IEmitterServices services, IReportRunnable reportRunnable,
		IReportContext context )
{
	IHyperlinkAction hyperlinkAction = area.getAction( );
	if ( hyperlinkAction != null )
	{
		try
		{
			if ( hyperlinkAction.getType( ) != IHyperlinkAction.ACTION_BOOKMARK )
			{
				String link = hyperlinkAction.getHyperlink( );
				String tooltip = hyperlinkAction.getTooltip( );
				Object handler = services
						.getOption( RenderOption.ACTION_HANDLER );
				if ( handler != null
						&& handler instanceof IHTMLActionHandler )
				{
					IHTMLActionHandler actionHandler = (IHTMLActionHandler) handler;
					String systemId = reportRunnable == null
							? null
							: reportRunnable.getReportName( );
					Action action = new Action( systemId, hyperlinkAction );
					link = actionHandler.getURL( action, context );
				}
				return new HyperlinkInfo( HyperlinkInfo.BOOKMARK, link, tooltip );
			}
		}
		catch ( Exception e )
		{
			logger.log( Level.WARNING, e.getMessage( ), e );
		}
	}
	return null;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:36,代码来源:OdpUtil.java


示例20: initialize

import org.eclipse.birt.report.engine.api.RenderOption; //导入依赖的package包/类
public void initialize( IEmitterServices service ) throws EngineException
{
	if ( service != null )
	{
		this.out = EmitterUtil.getOuputStream( service, "report."
				+ getOutputFormat( ) );
		this.reportRunnable = service.getReportRunnable( );
		this.actionHandler = (IHTMLActionHandler) service
				.getOption( RenderOption.ACTION_HANDLER );
		reportContext = service.getReportContext( );
		ULocale locale = null;
		if ( reportContext != null )
		{
			locale = ULocale.forLocale( reportContext.getLocale( ) );
		}
		if ( locale == null )
		{
			locale = ULocale.getDefault( );
		}
		EngineResourceHandle resourceHandle = new EngineResourceHandle(
				locale );
		messageFlashObjectNotSupported = resourceHandle
				.getMessage( MessageConstants.FLASH_OBJECT_NOT_SUPPORTED_PROMPT );
		messageReportItemNotSupported = resourceHandle
				.getMessage( MessageConstants.REPORT_ITEM_NOT_SUPPORTED_PROMPT );
		IRenderOption renderOption = service.getRenderOption( );
		if ( renderOption != null )
		{
			HTMLRenderOption htmlOption = new HTMLRenderOption(
					renderOption );
			layoutPreference = htmlOption.getLayoutPreference( );
		}
	}
	context = new EmitterContext( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:36,代码来源:AbstractEmitterImpl.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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