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

Java IReportRunnable类代码示例

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

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



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

示例1: getParameters

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
List<IParameterDefnBase> getParameters(IReportRunnable reportRunnable){
    IGetParameterDefinitionTask paramDefTask = reportEngine.createGetParameterDefinitionTask(reportRunnable);

    @SuppressWarnings("unchecked")
    Collection<IParameterDefnBase> coll = paramDefTask.getParameterDefns(true);
    java.util.Iterator<IParameterDefnBase> it = coll.iterator();
    List<IParameterDefnBase> parameters = new ArrayList<IParameterDefnBase>();
    while(it.hasNext()){
        IParameterDefnBase paramDef = it.next();
        if(paramDef instanceof IParameterGroupDefn){
            IParameterGroupDefn paramGroupDef = (IParameterGroupDefn) paramDef;
            if(paramGroupDef instanceof ICascadingParameterGroup){
                throw new NotImplementedException();
            }
            parameters.add(paramGroupDef);
        }
        else{
            parameters.add(paramDef);
        }
    }
    return parameters;
}
 
开发者ID:phuihock,项目名称:birtconn,代码行数:23,代码来源:ReportParametersInspector.java


示例2: testSortByOnDatasetColumn

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
public void testSortByOnDatasetColumn( ) throws EngineException,
		SemanticException
{
	IReportRunnable report = engine.openReportDesign( REPORT_DESIGN );
	IGetParameterDefinitionTask task = engine
			.createGetParameterDefinitionTask( report );

	Collection list = task.getSelectionListForCascadingGroup(
			"SortBysOfSingleDataSet", new Object[0] );
	Object[] content = list.toArray( );
	assertEquals( "USA", SelectionChoiceUtil.getValue( content[1] ) );

	list = task.getSelectionListForCascadingGroup(
			"SortBysOfSingleDataSet", new Object[]{"USA"} );
	content = list.toArray( );
	assertEquals( "MA", SelectionChoiceUtil.getValue( content[1] ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:GetParameterDefinitionTaskTest.java


示例3: testScriptCancel

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
public void testScriptCancel() throws Exception
{
	copyResource( PAGE_SCRIPT_HANDLER, REPORT_DESIGN );
	copyResource( PAGE_SCRIPT_JAR, JAR );
	removeFile( REPORT_DOCUMENT );
	IReportRunnable runnable = engine.openReportDesign( REPORT_DESIGN );
	IRunTask runTask = engine.createRunTask( runnable );
	runTask.run( REPORT_DOCUMENT );
	IReportContext reportContext = ((RunTask)runTask).getReportContext( );
	assertTrue(convertToBoolean(reportContext.getGlobalVariable( "REPORT_ONPAGESTART" )));
	assertTrue(convertToBoolean(reportContext.getGlobalVariable( "REPORT_ONPAGEEND" )));
	assertTrue(convertToBoolean(reportContext.getGlobalVariable( "MASTERPAGE_ONPAGESTART" )));
	assertTrue(convertToBoolean(reportContext.getGlobalVariable( "MASTERPAGE_ONPAGEEND" )));
	runTask.close( );
	removeFile( REPORT_DESIGN );
	removeFile( JAR );
	removeFile( REPORT_DOCUMENT );

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


示例4: createReportDocument

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
protected void createReportDocument( String reportdesign,
		String reportdocument ) throws Exception
{
	// open an report archive, it is a folder archive.
	IDocArchiveWriter archive = new FileArchiveWriter( reportdocument );
	// open the report runnable to execute.
	IReportRunnable report = engine.openReportDesign( reportdesign );

	// create an IRunTask
	IRunTask runTask = engine.createRunTask( report );
	// execute the report to create the report document.
	runTask.setAppContext( new HashMap( ) );
	runTask.run( archive );

	int i = runTask.getErrors( ).size( );
	if ( i > 0 )
		System.out.println( "error is "
				+ runTask.getErrors( ).get( 0 ).toString( ) );
	assertEquals(
			"Exception when generate document from " + reportdesign,
			0,
			i );

	// close the task, release the resource.
	runTask.close( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:PDFRenderOptionTest.java


示例5: testDesignStream

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
public void testDesignStream( )
{
	try
	{
		IReportRunnable runnable = engine
				.openReportDesign( new FileInputStream( new File(
						REPORT_DESIGN ) ) );
		IRunTask runTask = engine.createRunTask( runnable );
		runTask.run( REPORT_DOCUMENT );

		IReportDocument rptDoc = engine
				.openReportDocument( REPORT_DOCUMENT );
		InputStream inputStream = rptDoc.getDesignStream( );
		assertTrue( inputStream != null );
		int streamLength = ( (RAInputStream) inputStream ).available( );
		assertTrue( streamLength > 0 );
		rptDoc.close( );
	}
	catch ( Exception ex )
	{
		ex.printStackTrace( );
		fail( );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:25,代码来源:ReportDocumentTest.java


示例6: createReportDocument_param

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
/**
 * create the report document, set inputParams for it.
 * 
 * @throws Exception
 */
protected void createReportDocument_param( String reportdesign,
		String reportdocument ) throws Exception
{
	// open an report archive, it is a folder archive.
	IDocArchiveWriter archive = new FileArchiveWriter( reportdocument );
	// open the report runnable to execute.
	IReportRunnable report = engine.openReportDesign( reportdesign );
	reportRunnable = report;
	// create an IRunTask
	IRunTask task = engine.createRunTask( report );
	// set parameter to the report
	HashMap inputParam = new HashMap( );
	inputParam.put( "p1", "p1string" );
	inputParam.put( "p2", new Integer( 2 ) );
	task.setParameterValues( inputParam );
	// execute the report to create the report document.
	task.run( archive );
	// close the task, release the resource.
	task.close( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:26,代码来源:ReportDocumentTest.java


示例7: buildHyperlink

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
/**
 * Build URI
 * 
 * @param action
 * @param context
 * @return
 */
private String buildHyperlink( IAction action, IReportContext context )
{
	IReportRunnable runnable = context.getReportRunnable( );
	String actionURL = action.getActionString( );
	if ( runnable != null )
	{
		ModuleHandle moduleHandle = runnable.getDesignHandle( )
				.getModuleHandle( );
		URL url = moduleHandle.findResource( actionURL, -1 );
		if ( url != null )
			actionURL = url.toString( );
	}

	return actionURL;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:ViewerHTMLActionHandler.java


示例8: createReportDocument

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
/**
 * create the report document.
 * 
 * @return
 * @throws Exception
 */
protected String createReportDocument( String reportdesign,
		String reportdocument ) throws Exception
{
	reportdesign = this.genInputFile( reportdesign );
	reportdocument = this.genOutputFile( reportdocument );

	// open an report archive, it is a folder archive.
	IDocArchiveWriter archive = new FileArchiveWriter( reportdocument );
	// open the report runnable to execute.
	IReportRunnable report = engine.openReportDesign( reportdesign );
	// create an IRunTask
	IRunTask runTask = engine.createRunTask( report );
	// execute the report to create the report document.
	runTask.setAppContext( new HashMap( ) );
	runTask.run( archive );
	// close the task, release the resource.
	runTask.close( );
	return reportdocument;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:26,代码来源:DataExtractionTaskTest.java


示例9: createReportDocument

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
public void createReportDocument( String reportDesign, String reportDocument )
		throws EngineException
{
	// open the report runnable to execute.
	IReportRunnable report = engine.openReportDesign( reportDesign );
	// create an IRunTask
	IRunTask task = engine.createRunTask( report );
	try
	{
		// execute the report to create the report document.
		task.run( reportDocument );
	}
	finally
	{
		// close the task, release the resource.
		task.close( );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:EngineCase.java


示例10: runandrender_emitter

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


示例11: DataExtractionTaskV0

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
public DataExtractionTaskV0( ReportEngine engine, IReportDocument reader )
		throws EngineException
{
	super( engine, IEngineTask.TASK_DATAEXTRACTION );
	IReportRunnable runnable = getOnPreparedRunnable( reader );
	setReportRunnable( runnable );
	IInternalReportDocument internalDoc = (IInternalReportDocument)reader;
	Report reportIR = internalDoc.getReportIR( executionContext
			.getReportDesign( ) );
	executionContext.setReport( reportIR );
	this.report = executionContext.getReport( );
	// load the report
	this.reportDocReader = reader;
	executionContext.setReportDocument( reportDocReader );
	executionContext.setFactoryMode( false );
	executionContext.setPresentationMode( true );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:DataExtractionTaskV0.java


示例12: testExtractionFromInstanceId

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
public void testExtractionFromInstanceId( ) throws Exception
{
	// get the instance id
	// open the document in the archive.
	// create an RenderTask using the report document
	Set<InstanceID> instanceIds = getAllInstanceIds( document );
	for ( InstanceID iid : instanceIds )
	{
		long designId = iid.getComponentID( );
		IReportRunnable runnable = document.getReportRunnable( );
		ReportDesignHandle report = (ReportDesignHandle) runnable
				.getDesignHandle( );
		DesignElementHandle element = report.getElementByID( designId );
		if ( element instanceof TableHandle )
		{
			// we get the report let
			dataExTask.setInstanceID( iid );
			ArrayList resultSetList = (ArrayList) dataExTask
					.getResultSetList( );
			assertEquals( 1, resultSetList.size( ) );
			IExtractionResults results = dataExTask.extract( );
			int rowCount = checkExtractionResults( results );
			assertTrue( rowCount > 0 );
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:DataExtractionTaskTest.java


示例13: testDynamicFilterParameters

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
public void testDynamicFilterParameters( ) throws EngineException
{
	copyResource( DYNAMIC_FILTER_DESIGN, REPORT_DESIGN );
	IReportRunnable runnable = engine.openReportDesign( REPORT_DESIGN );
	IGetParameterDefinitionTask task = engine
			.createGetParameterDefinitionTask( runnable );

	// get parameter defn
	IParameterDefnBase param = task.getParameterDefn( "Param_1" );
	if ( param instanceof IDynamicFilterParameterDefn )
	{
		IDynamicFilterParameterDefn dynParam = (IDynamicFilterParameterDefn) param;
		assertNotNull( dynParam.getColumn( ) );
	}
	else
		fail( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:GetParameterDefinitionTaskTest.java


示例14: loadDesign

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
protected void loadDesign( )
{
	if ( !jsLoaded )
	{
		jsLoaded = true;
		IReportRunnable runnable = executionContext.getRunnable( );
		if ( runnable != null )
		{
			ReportDesignHandle reportDesign = executionContext
					.getReportDesign( );
			if ( reportDesign != null )
			{
				// execute scripts defined in include-script element of the
				// libraries
				Iterator iter = reportDesign
						.includeLibraryScriptsIterator( );
				loadScript( iter );
				// execute scripts defined in include-script element of this
				// report
				iter = reportDesign.includeScriptsIterator( );
				loadScript( iter );
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:26,代码来源:GetParameterDefinitionTask.java


示例15: getReportRunnable

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
public synchronized IReportRunnable getReportRunnable( )
{
	if ( reportRunnable == null )
	{
		reportRunnable = loadReportRunnable( systemId,
				ORIGINAL_DESIGN_STREAM );
		if ( reportRunnable != null )
		{
			reportRunnable.setPrepared( false );
		}
		else
		{
			reportRunnable = getOnPreparedRunnable( );
		}
	}
	if ( reportRunnable != null )
	{
		return reportRunnable.cloneRunnable( );
	}
	return null;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:22,代码来源:ReportDocumentReader.java


示例16: setReportRunnable

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
public void setReportRunnable( IReportRunnable runnable )
{
	if ( runnable != null )
	{
		Properties systemProperties = SecurityUtil.getSystemProperties( );
		executionContext.setRunnable( runnable );
		// register the properties into the scope, so the user can
		// access the config through the property name directly.
		executionContext.registerBeans( systemProperties );
		executionContext.registerBeans( runnable.getTestConfig( ) );
		// put the properties into the configs also, so the user can
		// access the config through config["name"].
		executionContext.getConfigs( ).putAll( systemProperties );
		executionContext.getConfigs( ).putAll( runnable.getTestConfig( ) );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:EngineTask.java


示例17: validateParameters

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
public boolean validateParameters( )
{
	IReportRunnable runnable = executionContext.getRunnable( );
	if ( runnable == null )
	{
		return false;
	}

	// set the parameter values into the execution context
	try
	{
		return doValidateParameters( );
	}
	catch(ParameterValidationException ex)
	{
		log.log( Level.SEVERE, ex.getMessage( ), ex );
	}
	return false;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:20,代码来源:EngineTask.java


示例18: loadScripts

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
protected void loadScripts( )
{
	IReportRunnable runnable = executionContext.getRunnable( );
	if ( runnable != null )
	{
		ReportDesignHandle reportDesign = executionContext.getReportDesign( );
		if ( reportDesign != null )
		{
			// execute scripts defined in include-script element of the
			// libraries
			Iterator iter = reportDesign.includeLibraryScriptsIterator( );
			loadScript( iter );
			// execute scripts defined in include-script element of this
			// report
			iter = reportDesign.includeScriptsIterator( );
			loadScript( iter );
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:20,代码来源:EngineTask.java


示例19: findParameter

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
/**
 * find the parameter handle by parameter name
 * 
 * @param reportDesignHandle
 * @param paramName
 * @return
 * @throws ReportServiceException
 */
public static ParameterHandle findParameter(
		IViewerReportDesignHandle reportDesignHandle, String paramName )
		throws ReportServiceException
{
	if ( paramName == null )
		return null;

	IReportRunnable runnable = (IReportRunnable) reportDesignHandle.getDesignObject( );
	if ( runnable == null )
		return null;

	// get module handle from report runnable
	ModuleHandle model = runnable.getDesignHandle( ).getModuleHandle( );
	if ( model == null )
		return null;

	return model.findParameter( paramName );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:BirtUtility.java


示例20: testPreviewDatasetInReport

import org.eclipse.birt.report.engine.api.IReportRunnable; //导入依赖的package包/类
public void testPreviewDatasetInReport( ) throws Exception
{		
	copyResource( REPORT_DESIGN_RESOURCE, REPORT_DESIGN );
	previewTask = engine.createDatasetPreviewTask( );
	IReportRunnable reportDesign = engine.openReportDesign( REPORT_DESIGN );
	List ds = reportDesign.getDesignHandle( ).getModuleHandle( )
			.getAllDataSets( );
	for ( Object obj : ds )
	{
		DataSetHandle dataset = (DataSetHandle) obj;
		if ( dataset.getName( ).equals( "DataSet" ) )
		{
			previewTask.setDataSet( dataset );
		}
	}

	previewTask.setMaxRow( 5 );
	IExtractionResults results = previewTask.execute( );
	int rowCount = checkExtractionResults( results );
	assertTrue( rowCount == 5 );
	previewTask.close( );
	removeFile( REPORT_DESIGN );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:24,代码来源:DatasetPreviewTaskTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java PluginBase类代码示例发布时间:2022-05-22
下一篇:
Java OWLReasonerConfiguration类代码示例发布时间: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