本文整理汇总了Java中org.eclipse.birt.report.engine.api.EngineException类的典型用法代码示例。如果您正苦于以下问题:Java EngineException类的具体用法?Java EngineException怎么用?Java EngineException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EngineException类属于org.eclipse.birt.report.engine.api包,在下文中一共展示了EngineException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:interseroh,项目名称:report-cockpit-birt-web,代码行数:24,代码来源:BirtReportServiceBean.java
示例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);
}
}
开发者ID:interseroh,项目名称:report-cockpit-birt-web,代码行数:26,代码来源:BirtReportServiceBean.java
示例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);
}
开发者ID:interseroh,项目名称:report-cockpit-birt-web,代码行数:17,代码来源:BirtHtmlReportServiceTest.java
示例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( ) );
}
}
开发者ID:eclipse,项目名称:birt,代码行数:22,代码来源:ReportletIVTest.java
示例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 );
}
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:ReportQueryBuilder.java
示例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 );
}
}
}
}
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:ReportExtensionExecutor.java
示例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 );
}
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:DataExtractionTaskV0.java
示例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( );
}
}
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:RunTask.java
示例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;
}
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:QueryContext.java
示例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 );
}
开发者ID:eclipse,项目名称:birt,代码行数:25,代码来源:DtEScriptExecutor.java
示例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( ) );
}
}
}
}
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:ParameterPromptTextTest.java
示例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;
}
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:AbstractViewer.java
示例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 );
}
}
}
}
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:ReportExtensionExecutor.java
示例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;
}
开发者ID:eclipse,项目名称:birt,代码行数:25,代码来源:EngineCase.java
示例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( );
}
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:GetParameterDefinitionTaskTest.java
示例16: evaluateCondExpr
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
/**
* evaluate conditional expression. A conditional expression can have an
* operator, one LHS expression, and up to two expressions on RHS, i.e.,
*
* testExpr operator operand1 operand2 or testExpr between 1 20
*
* Now only support comparison between the same data type
*
* @param expr
* the conditional expression to be evaluated
* @return a boolean value (as an Object)
*/
public Object evaluateCondExpr( IConditionalExpression expr )
throws BirtException
{
IScriptExpression testExpr = expr.getExpression( );
ScriptContext scriptContext = getScriptContext( );
if ( testExpr == null )
return Boolean.FALSE;
try
{
return ScriptEvalUtil.evalExpr( expr, scriptContext,
ScriptExpression.defaultID, 0 );
}
catch ( Throwable e )
{
throw new EngineException(
MessageConstants.INVALID_EXPRESSION_ERROR, testExpr
.getText( ), e );
}
}
开发者ID:eclipse,项目名称:birt,代码行数:32,代码来源:ExecutionContext.java
示例17: loadRenderExtensions
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
private ArrayList<IRenderExtension> loadRenderExtensions( )
throws EngineException
{
if ( renderExtensionLoaded == false )
{
String[] extensions = executionContext.getEngineExtensions( );
if ( extensions != null )
{
renderExtensions = new ArrayList<IRenderExtension>( );
EngineExtensionManager manager = executionContext
.getEngineExtensionManager( );
for ( String extName : extensions )
{
IRenderExtension renderExtension = manager
.getRenderExtension( extName );
if ( renderExtension != null )
{
renderExtensions.add( renderExtension );
}
}
}
}
return renderExtensions;
}
开发者ID:eclipse,项目名称:birt,代码行数:26,代码来源:FixedRenderTask.java
示例18: ReportPageExecutor
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
public ReportPageExecutor( ExecutionContext context, List pages,
boolean paged ) throws BirtException
{
try
{
int version = getVersion( context.getReportDocument( ) );
switch ( version )
{
case EXECUTOR_VERSION_3 :
executor = new ReportPageExecutorV3( context, pages, paged );
break;
case EXECUTOR_VERSION_4 :
executor = new ReportPageExecutorV4( context, pages, paged );
break;
default :
throw new EngineException( MessageConstants.UNSUPPORTED_DOCUMENT_VERSION_ERROR
, version );
}
}
catch ( IOException ex )
{
throw new EngineException( ex.getLocalizedMessage( ), ex );
}
}
开发者ID:eclipse,项目名称:birt,代码行数:26,代码来源:ReportPageExecutor.java
示例19: processQueryExtensions
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的package包/类
static public void processQueryExtensions( IDataQueryDefinition query,
ExecutionContext executionContext ) throws EngineException
{
String[] extensions = executionContext.getEngineExtensions( );
if ( extensions != null )
{
EngineExtensionManager manager = executionContext
.getEngineExtensionManager( );
for ( String extensionName : extensions )
{
IDataExtension extension = manager
.getDataExtension( extensionName );
if ( extension != null )
{
extension.prepareQuery( query );
}
}
}
}
开发者ID:eclipse,项目名称:birt,代码行数:20,代码来源:QueryUtil.java
示例20: initialize
import org.eclipse.birt.report.engine.api.EngineException; //导入依赖的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
注:本文中的org.eclipse.birt.report.engine.api.EngineException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论