本文整理汇总了Java中org.eclipse.birt.report.engine.api.EngineException类的典型用法代码示例。如果您正苦于以下问题:Java EngineException类的具体用法?Java EngineException怎么用?Java EngineException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EngineException类属于org.eclipse.birt.report.engine.api包,在下文中一共展示了EngineException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderPDFReport
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
@Override
public void renderPDFReport(String reportName,
Map<String, Object> parameters, OutputStream out)
throws BirtReportException {
try {
IRunAndRenderTask runAndRenderTask = createRunAndRenderTask(
reportName);
injectParameters(parameters, runAndRenderTask);
PDFRenderOption pdfOptions = new PDFRenderOption();
pdfOptions.setOutputFormat(IRenderOption.OUTPUT_FORMAT_PDF);
pdfOptions.setOutputStream(out);
pdfOptions.setEmbededFont(true); // TODO idueppe - should be
// configurable from cockpit
pdfOptions.setImageHandler(new HTMLServerImageHandler());
runAndRenderTask(runAndRenderTask, pdfOptions);
} catch (EngineException | IOException e) {
throw new RenderReportException("pdf", reportName, e);
}
}
示例2: renderExcelReport
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
@Override
public void renderExcelReport(String reportName,
Map<String, Object> parameters, OutputStream out)
throws BirtReportException {
try {
IRunAndRenderTask runAndRenderTask = createRunAndRenderTask(
reportName);
injectParameters(parameters, runAndRenderTask);
EXCELRenderOption excelRenderOptions = new EXCELRenderOption();
excelRenderOptions.setOutputFormat("xlsx");
excelRenderOptions.setOutputStream(out);
excelRenderOptions.setEnableMultipleSheet(true);
// TODO idueppe - should be configurable from cockpit
excelRenderOptions.setHideGridlines(true);
// TODO idueppe - should be configurable from cockpit
// excelRenderOptions.setOfficeVersion();
// TODO idueppe - should be configurable from cockpit
excelRenderOptions.setImageHandler(new HTMLServerImageHandler());
runAndRenderTask(runAndRenderTask, excelRenderOptions);
} catch (EngineException | IOException e) {
throw new RenderReportException("excel", reportName, e);
}
}
示例3: renderHtmlReport
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
private void renderHtmlReport(String reportName) throws EngineException,
FileNotFoundException, BirtReportException {
String outputFileName = "target/" + reportName + ".html";
Collection<ParameterGroup> groups = reportService
.getParameterGroups(reportName);
Map<String, Object> params = new HashMap<>();
for (ParameterGroup group : groups)
for (ScalarParameter definition : group.getParameters()) {
if ("OrderNumber".equals(definition.getName()))
params.put("OrderNumber", 10110);
}
FileOutputStream fos = new FileOutputStream(outputFileName);
reportService.renderHtmlReport(reportName, params, fos);
}
示例4: setUp
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
public void setUp( ) throws Exception
{
super.setUp( );
new File( "./utest" ).mkdirs( );
copyResource( RESOURCE_REPORTLET_IV_DESIGN, REPORTLET_IV_DESIGN );
copyResource( RESOURCE_REPORTLET_QUERY_IV_DESIGN,
REPORTLET_QUERY_IV_DESIGN );
copyResource( RESOURCE_REPORTLET_SUBQUERY_IV_DESIGN,
REPORTLET_SUBQUERY_IV_DESIGN );
copyResource( RESOURCE_REPORTLET_NESTQUERY_IV_DESIGN,
REPORTLET_NESTQUERY_IV_DESIGN );
// create a report document
try
{
createReportDocument( REPORTLET_IV_DESIGN, REPORTLET_IV_DOCUMENT );
}
catch ( EngineException ex )
{
fail( ex.getMessage( ) );
}
}
示例5: addNewColumnBindings
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
protected void addNewColumnBindings( IDataQueryDefinition query,
ITotalExprBindings totalExpressionBindings )
throws BirtException
{
if ( query instanceof IBaseQueryDefinition )
{
addQueryColumnBindings( (IBaseQueryDefinition) query,
totalExpressionBindings );
return;
}
if ( query instanceof ICubeQueryDefinition )
{
addCubeColumnBindings( (ICubeQueryDefinition) query,
totalExpressionBindings );
return;
}
throw new EngineException( MessageConstants.UNSUPPORTED_QUERY_DEFINITION_ERROR , query );
}
示例6: startReportProcess
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
void startReportProcess( IReportContent report )
{
if ( report != null )
{
for ( IContentProcessor processor : processors )
{
try
{
processor.start( report );
}
catch ( EngineException ex )
{
context.addException( ex );
}
}
}
}
示例7: DataExtractionTaskV0
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的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 );
}
示例8: run
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
public void run( IDocArchiveWriter archive ) throws EngineException
{
try
{
switchToOsgiClassLoader( );
changeStatusToRunning( );
if ( archive == null )
{
throw new EngineException(
MessageConstants.REPORT_ARCHIVE_ERROR ); //$NON-NLS-1$
}
this.archiveWriter = archive;
doRun( );
}
finally
{
changeStatusToStopped( );
switchClassLoaderBack( );
}
}
示例9: getDataRequestSession
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
public DataRequestSession getDataRequestSession( )
{
if ( context != null )
{
try
{
IDataEngine dataEngine = context.getDataEngine( );
return dataEngine.getDTESession( );
}
catch ( EngineException e )
{
context.addException( e );
}
}
return null;
}
示例10: handleJS
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
protected ScriptStatus handleJS( Scriptable scope,
String type, String name, String method, String script, String id )
{
if ( script == null || type == null || name == null || method == null )
return ScriptStatus.NO_RUN;
if ( !( DATA_SET.equals( type ) || DATA_SOURCE.equals( type ) ) )
return ScriptStatus.NO_RUN;
Object result = null;
try
{
JSMethodRunner jsr = getRunner( scope, type, name );
result = jsr.runScript( method, script, id );
} catch ( Exception e )
{
log.log( Level.WARNING, e.getMessage( ), e );
if ( context != null )
context.addException( new EngineException( MessageConstants.SCRIPT_EVALUATION_ERROR,
new Object[]{
script, e.getMessage( )
},
e ) );
}
return new ScriptStatus( true, result );
}
示例11: testCascadingParameterPromptText
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
public void testCascadingParameterPromptText( ) throws EngineException
{
IReportRunnable runnable = engine.openReportDesign( REPORT_GROUP_PROMPT_TEXT_DESIGN );
ReportDesignHandle handle = (ReportDesignHandle) ( (ReportRunnable) runnable ).getDesignHandle( );
GetParameterDefinitionTask paramTask = (GetParameterDefinitionTask) engine.createGetParameterDefinitionTask( runnable );
parameters = paramTask.getParameters( handle, true );
assertTrue( parameters != null );
if ( parameters != null && parameters.size( ) > 0 )
{
for ( int i = 0; i < parameters.size( ); i++ )
{
IParameterDefnBase parameter = (IParameterDefnBase) parameters.get( i );
if ( parameter instanceof ParameterGroupDefn )
{
assertEquals( "testParameterGroupDefnPromptText",
( (ParameterGroupDefn) parameter ).getPromptText( ) );
}
}
}
}
示例12: getInputParameters
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
protected List getInputParameters( String reportDesignFile )
{
try
{
IGetParameterDefinitionTask task = engine.createGetParameterDefinitionTask( engine.openReportDesign( reportDesignFile ) );
ParameterFactory factory = new ParameterFactory( task );
List parameters = factory.getRootChildren( );
task.close( );
task = null;
return parameters;
}
catch ( EngineException e )
{
}
return null;
}
示例13: startItemProcess
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
void startItemProcess( IContent content )
{
if ( content != null )
{
for ( IContentProcessor processor : processors )
{
try
{
processor.startContent( content );
}
catch ( EngineException ex )
{
context.addException( ex );
}
}
}
}
示例14: runAndRender
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
/**
* Run and render the report, and return the render result.
*
* @param designFile
* @return render result.
* @throws EngineException
* @throws IOException
*/
protected String runAndRender( String designFile ) throws EngineException,
IOException
{
IRunAndRenderTask runAndRenderTask = createRunAndRenderTask( designFile );
HTMLRenderOption options = new HTMLRenderOption( );
ByteArrayOutputStream out = new ByteArrayOutputStream( );
options.setOutputStream( out );
options.setOutputFormat( "html" );
options.setHtmlPagination( true );
runAndRenderTask.setRenderOption( options );
runAndRenderTask.run( );
runAndRenderTask.close( );
String result = new String( out.toByteArray( ) );
out.close( );
return result;
}
示例15: testDynamicFilterParameters
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的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( );
}