本文整理汇总了Java中org.eclipse.birt.core.exception.BirtException类的典型用法代码示例。如果您正苦于以下问题:Java BirtException类的具体用法?Java BirtException怎么用?Java BirtException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BirtException类属于org.eclipse.birt.core.exception包,在下文中一共展示了BirtException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getObject
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
@Override
public IReportEngine getObject() throws Exception {
try {
EngineConfig config = getEngineConfig();
Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
birtEngine = factory.createReportEngine(config);
return birtEngine;
} catch (BirtException be) {
throw new BirtSystemException("Failed to start birt engine.", be);
}
}
示例2: flush
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
public void flush( ) throws BirtException
{
if ( emitter instanceof BufferedReportEmitter )
{
( (BufferedReportEmitter) emitter ).events.addAll( events );
}
else
{
Iterator eventIter = events.iterator( );
while ( eventIter.hasNext( ) )
{
BufferedNode node = (BufferedNode) eventIter.next( );
if ( node.start )
{
ContentEmitterUtil.startContent( node.content, emitter );
}
else
{
ContentEmitterUtil.endContent( node.content, emitter );
}
}
}
events.clear( );
}
示例3: endContainerInPages
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
protected void endContainerInPages( IContent content, boolean finished,
IContentEmitter emitter, boolean visible ) throws BirtException
{
if ( currentTableIndex == nestCount && currentTableIndex > 0 )
{
for ( int i = 0; i < buffers.length - 1; i++ )
{
buffers[i].endContainer( content, false, emitter, visible );
}
buffers[buffers.length - 1].endContainer( content, finished,
emitter, visible );
}
else
{
currentBuffer.endContainer( content, finished, emitter, visible );
}
}
示例4: testThreeTablesRenderCustomTask
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
@Test
public void testThreeTablesRenderCustomTask() throws BirtException, IOException {
InputStream inputStream = runAndRenderReportCustomTask("MultiSheets1.rptdesign", "xlsx");
assertNotNull(inputStream);
try {
XSSFWorkbook workbook = new XSSFWorkbook(inputStream);
assertNotNull(workbook);
assertEquals( 1, workbook.getNumberOfSheets() );
assertEquals( "Number Formats Test Report", workbook.getSheetAt(0).getSheetName());
assertEquals(11, firstNullRow(workbook.getSheetAt(0)));
} finally {
inputStream.close();
}
}
示例5: next
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
public boolean next( ) throws BirtException
{
if( !existCachedFile )
{
return false;
}
checkStarted( );
if( this.columnValueMap == null )
return false;
if( lastRowIndex < currRowIndex)
{
currRowIndex++;
readCurrentRow( );
}
else
{
lastRowIndex = currRowIndex -1;
}
return this.columnValueMap != null && this.columnValueMap.size( ) > 0;
}
示例6: getLevelNameFromDimensionExpression
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
/**
* This method is used to get the level name that reference by a level
* reference expression of following format:
* dimension["dimensionName"]["levelName"].
*
* String[0] dimensionName; String[1] levelName;
*
* @param expr
* @return String[]
* @since 2.3
*/
private static String[] getLevelNameFromDimensionExpression( String expr )
{
if ( ChartExpressionUtil.isDimensionExpresion( expr ) )
{
try
{
Set<IDimLevel> levels = ExpressionUtil.getReferencedDimLevel( expr );
if ( !levels.isEmpty( ) )
{
IDimLevel level = levels.iterator( ).next( );
return new String[]{
level.getDimensionName( ), level.getLevelName( ), level.getAttrName( )
};
}
}
catch ( BirtException e )
{
logger.log( e );
}
}
return null;
}
示例7: testFactTableDocumentObjectNameUtil
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
/**
*
* @throws IOException
* @throws BirtException
*/
@Test
public void testFactTableDocumentObjectNameUtil( ) throws IOException,
BirtException
{
int[] i1 = {
12, 13, 14, 15
};
assertEquals( FTSUDocumentObjectNamingUtil.getDocumentObjectName( "", i1 ),
"12X13X14X15" );
int[] i2 = {
12
};
assertEquals( FTSUDocumentObjectNamingUtil.getDocumentObjectName( "", i2 ),
"12" );
int[] i3 = {
1
};
assertEquals( FTSUDocumentObjectNamingUtil.getDocumentObjectName( "", i3 ),
"1" );
int[] i4 = {
1,12, 313, 55514, 4415
};
assertEquals( FTSUDocumentObjectNamingUtil.getDocumentObjectName( "", i4 ),
"1X12X313X55514X4415" );
}
示例8: onRow
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
public void onRow( Object[] args ) throws DataException
{
assert ( args.length > 0 );
if ( args[0] != null )
{
try
{
if ( count == 1 )
{
if ( args[1] != null )
rate = DataTypeUtil.toDouble( args[1] )
.doubleValue( );
else
rate = DataTypeUtil.toDouble( 0 );
}
npv = calculator.add( npv, calculator.divide( calculator.getTypedObject( args[0] ),
calculator.getTypedObject( Math.pow( ( 1 + rate ), (double) count++ ) ) ) );
}
catch ( BirtException e )
{
throw DataException.wrap( new AggrException( ResourceConstants.DATATYPEUTIL_ERROR,
e ) );
}
}
}
示例9: close
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
/**
* access the query and create the contents. the execution process is:
* <li> the cursor is at the begin of result set.
* <li> call listing's onStart event
* <li> create the header
* <li> for each row:
* <ul>
* <li> call onRow event.
* <li> if the row start some groups, create the group header for that
* group.
* <li> create the detail row.
* <li> if the row end some groups, create the group footer for that group.
* </ul>
* <li> create the footer.
* <li> call the onFinish event.
*/
public void close( ) throws BirtException
{
if( pageBreakInterval != -1 )
{
context.removePageBreakListener( this );
}
rsetCursor = -1;
needPageBreak = false;
pageRowCount = 0;
pageBreakInterval = -1;
executableElements = null;
// total bands in the executabelBands
totalElements = 0;
// band to be executed
currentElement = 0;
endOfListing = false;
breakOnDetailBand = false;
pageBreakLevel = -1;
softBreakBefore = false;
addAfterBreak = false;
super.close( );
}
示例10: testRunReportXls
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
@Test
public void testRunReportXls() throws BirtException, IOException {
InputStream inputStream = runAndRenderReport("CurrencyFormats.rptdesign", "xls");
assertNotNull(inputStream);
try {
HSSFWorkbook workbook = new HSSFWorkbook(inputStream);
assertNotNull(workbook);
assertEquals( 1, workbook.getNumberOfSheets() );
assertEquals( "Currency Formats Test Report", workbook.getSheetAt(0).getSheetName());
Sheet sheet = workbook.getSheetAt(0);
assertEquals(5, this.firstNullRow(sheet));
DataFormatter formatter = new DataFormatter();
assertEquals( "�3141.59", formatter.formatCellValue(sheet.getRow(1).getCell(1)));
assertEquals( "$3141.59", formatter.formatCellValue(sheet.getRow(2).getCell(1)));
assertEquals( "�3141.59", formatter.formatCellValue(sheet.getRow(3).getCell(1)));
assertEquals( "�3141.59", formatter.formatCellValue(sheet.getRow(4).getCell(1)));
} finally {
inputStream.close();
}
}
示例11: executeMasterPage
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
public static IPageContent executeMasterPage( IReportExecutor executor,
long pageNumber, MasterPageDesign pageDesign ) throws BirtException
{
IReportItemExecutor pageExecutor = executor.createPageExecutor(
pageNumber, pageDesign );
if ( pageExecutor != null )
{
IPageContent pageContent = (IPageContent) pageExecutor.execute( );
if ( pageContent != null )
{
DOMBuilderEmitter emitter = new DOMBuilderEmitter( pageContent );
executeAll( pageExecutor, emitter );
}
pageExecutor.close( );
return pageContent;
}
return null;
}
示例12: prepareReportParameters
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
private Map<String, ?> prepareReportParameters(IReportEngine engine, IReportRunnable design,
Map<String, String[]> parameters) throws BirtException
{
Map<String, Object> results = new HashMap<String, Object>();
IGetParameterDefinitionTask task = createReportParametersTask(engine, design);
@SuppressWarnings("unchecked")
Collection<IParameterDefnBase> parameterDefns = task.getParameterDefns(false);
for( IParameterDefnBase param : parameterDefns )
{
if( param.getParameterType() == IParameterDefnBase.SCALAR_PARAMETER )
{
String paramName = param.getName();
String[] currentValue = parameters.get(paramName);
if( currentValue != null )
{
Object[] converted = new Object[currentValue.length];
String dataType = ((ScalarParameterHandle) param.getHandle()).getDataType();
IScalarParameterDefn scalar = (IScalarParameterDefn) param;
for( int i = 0; i < currentValue.length; i++ )
{
converted[i] = ParameterValidationUtil.validate(dataType, getDefaultDateFormat(dataType),
currentValue[i], CurrentLocale.getLocale());
}
if( scalar.getScalarParameterType().equals("multi-value") )
{
results.put(paramName, converted);
}
else
{
results.put(paramName, converted[0]);
}
}
}
}
task.close();
return results;
}
示例13: startBirtEngine
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static synchronized void startBirtEngine(IPlatformContext context)
{
log.info("Starting BIRT Engine and OSGI Platform using: " + context.getClass().getName());
HTMLServerImageHandler imageHandler = new HTMLServerImageHandler();
HTMLRenderOption emitterConfig = new HTMLRenderOption();
emitterConfig.setActionHandler(new HTMLActionHandler());
emitterConfig.setImageHandler(imageHandler);
EngineConfig config = new EngineConfig();
config.setEngineHome("");
config.setPlatformContext(context);
config.setLogConfig(null, Level.ALL);
config.getEmitterConfigs().put("html", emitterConfig);
try
{
Platform.startup(config);
}
catch (BirtException e)
{
log.error("BirtException", e);
}
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
birtEngine = factory.createReportEngine(config);
log.info("BIRT Engine Started");
birtEngine.changeLogLevel(Level.SEVERE);
}
示例14: subtract
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
/**
*
* @param obj1
* @param obj2
* @return
* @throws BirtException
*/
public static final Number subtract( Object obj1, Object obj2 )
throws BirtException
{
return doOp( populateOprand( obj1 ),
populateOprand( obj2 ),
Operator.SUBTRACT );
}
示例15: startContainer
import org.eclipse.birt.core.exception.BirtException; //导入依赖的package包/类
public void startContainer( IContainerContent container )
throws BirtException
{
for (int i = 0; i < emitters.size(); i++)
{
((IContentEmitter)emitters.get(i)).startContainer(container);
}
}