本文整理汇总了Java中org.eclipse.birt.report.engine.api.IReportRunnable类的典型用法代码示例。如果您正苦于以下问题:Java IReportRunnable类的具体用法?Java IReportRunnable怎么用?Java IReportRunnable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IReportRunnable类属于org.eclipse.birt.report.engine.api包,在下文中一共展示了IReportRunnable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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] ) );
}
示例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 );
}
示例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( );
}
示例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( );
}
}
示例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( );
}
示例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;
}
示例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;
}
示例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( );
}
}
示例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;
}
示例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 );
}
示例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 );
}
}
}
示例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( );
}
示例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 );
}
}
}
}
示例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;
}