当前位置: 首页>>代码示例>>Java>>正文


Java BirtException类代码示例

本文整理汇总了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);
	}

}
 
开发者ID:interseroh,项目名称:report-cockpit-birt-web,代码行数:17,代码来源:BirtEngineFactory.java

示例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( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:25,代码来源:BufferedReportEmitter.java

示例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 );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:TableBreakBuffer.java

示例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();
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:SingleSheetsReportTest.java

示例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;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:22,代码来源:CacheResultIterator.java

示例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;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:34,代码来源:ChartExpressionUtil.java

示例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" );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:31,代码来源:FactTableHelperTest.java

示例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 ) );
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:TotalRunningNpv.java

示例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( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:39,代码来源:ListingElementExecutor.java

示例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();
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:CurrencyFormatsTest.java

示例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;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:ReportExecutorUtil.java

示例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;
}
 
开发者ID:equella,项目名称:Equella,代码行数:41,代码来源:ReportingServiceImpl.java

示例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);	
}
 
开发者ID:mtpettyp,项目名称:openreports,代码行数:36,代码来源:BirtProvider.java

示例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 );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:15,代码来源:MathUtil.java

示例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);
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:9,代码来源:CompositeContentEmitter.java


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