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


Java JRValidationException类代码示例

本文整理汇总了Java中net.sf.jasperreports.engine.design.JRValidationException的典型用法代码示例。如果您正苦于以下问题:Java JRValidationException类的具体用法?Java JRValidationException怎么用?Java JRValidationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JRValidationException类属于net.sf.jasperreports.engine.design包,在下文中一共展示了JRValidationException类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setValidationMarkers

import net.sf.jasperreports.engine.design.JRValidationException; //导入依赖的package包/类
protected void setValidationMarkers(JRValidationException e, JasperDesign design) {
	for (JRValidationFault fault : e.getFaults()) {
		String message = fault.getMessage();
		SourceLocation location = null;
		Object source = fault.getSource();
		if (source != null) {
			location = digester.getLocation(source);
			if (location == null)
				message = message + " --- " + source.toString(); //$NON-NLS-1$
		}
		if (source instanceof StandardTable){
			JRDesignElement componentElement = getElementFromTable(design.getAllBands(), (StandardTable)source);
			if (componentElement != null) source = componentElement;
		}
		if (location == null && source instanceof JRDesignElement) errorHandler.addMarker(message, location, (JRDesignElement)source);
		else errorHandler.addMarker(message, location);
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:19,代码来源:JasperReportCompiler.java

示例2: createObject

import net.sf.jasperreports.engine.design.JRValidationException; //导入依赖的package包/类
/**
 * Creates an object from a subreport copied value XML element.
 * 
 * @param atts the element attributes
 * @return a {@link JRDesignSubreportReturnValue JRDesignSubreportReturnValue} object
 */
@Override
public Object createObject(Attributes atts)
{
	JRXmlLoader xmlLoader = (JRXmlLoader) digester.peek(digester.getCount() - 1);
	JasperDesign design = (JasperDesign) digester.peek(digester.getCount() - 2);
	
	JRDesignSubreportReturnValue returnValue = new JRDesignSubreportReturnValue();

	String variableName = atts.getValue(JRXmlConstants.ATTRIBUTE_toVariable);
	JRVariable variable = design.getVariablesMap().get(variableName);
	if (variable == null)
	{
		xmlLoader.addError(new JRValidationException("Unknown variable " + variableName, returnValue));
	}
	
	returnValue.setSubreportVariable(atts.getValue(JRXmlConstants.ATTRIBUTE_subreportVariable));
	returnValue.setToVariable(variableName);

	CalculationEnum calculation = CalculationEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_calculation));
	if (calculation != null)
	{
		returnValue.setCalculation(calculation);
	}
	
	String incrementerFactoryClass = atts.getValue(JRXmlConstants.ATTRIBUTE_incrementerFactoryClass);
	if (incrementerFactoryClass != null)
	{
		returnValue.setIncrementerFactoryClassName(incrementerFactoryClass);
	}

	return returnValue;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:39,代码来源:JRSubreportReturnValueFactory.java

示例3: createObject

import net.sf.jasperreports.engine.design.JRValidationException; //导入依赖的package包/类
/**
 * @param atts the element attributes
 * @return a {@link DesignExpressionReturnValue DesignExpressionReturnValue} object
 */
@Override
public Object createObject(Attributes atts)
{
	JRXmlLoader xmlLoader = (JRXmlLoader) digester.peek(digester.getCount() - 1);
	JasperDesign design = (JasperDesign) digester.peek(digester.getCount() - 2);
	
	DesignExpressionReturnValue returnValue = new DesignExpressionReturnValue();

	String variableName = atts.getValue(JRXmlConstants.ATTRIBUTE_toVariable);
	JRVariable variable = design.getVariablesMap().get(variableName);
	if (variable == null)
	{
		xmlLoader.addError(new JRValidationException("Unknown variable " + variableName, returnValue));
	}
	
	returnValue.setToVariable(variableName);

	CalculationEnum calculation = CalculationEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_calculation));
	if (calculation != null)
	{
		returnValue.setCalculation(calculation);
	}
	
	String incrementerFactoryClass = atts.getValue(JRXmlConstants.ATTRIBUTE_incrementerFactoryClass);
	if (incrementerFactoryClass != null)
	{
		returnValue.setIncrementerFactoryClassName(incrementerFactoryClass);
	}

	return returnValue;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:36,代码来源:ExpressionReturnValueFactory.java

示例4: groupNotFound

import net.sf.jasperreports.engine.design.JRValidationException; //导入依赖的package包/类
@Override
public void groupNotFound(String groupName) throws JRValidationException
{
	throw new JRValidationException("Unknown reprint group '" + groupName + "' for element.", element);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:6,代码来源:ElementReprintGroupReference.java

示例5: groupNotFound

import net.sf.jasperreports.engine.design.JRValidationException; //导入依赖的package包/类
@Override
public void groupNotFound(String groupName) throws JRValidationException
{
	throw new JRValidationException("Unknown evaluation group '" + groupName + "' for chart.", chart);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:6,代码来源:ChartEvaluationGroupReference.java

示例6: groupNotFound

import net.sf.jasperreports.engine.design.JRValidationException; //导入依赖的package包/类
@Override
public void groupNotFound(String groupName) throws JRValidationException
{
	throw new JRValidationException("Unknown evaluation group '" + groupName + "' for image.", image);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:6,代码来源:ImageEvaluationGroupReference.java

示例7: groupNotFound

import net.sf.jasperreports.engine.design.JRValidationException; //导入依赖的package包/类
@Override
public void groupNotFound(String groupName) throws JRValidationException
{
	throw new JRValidationException("Unknown evaluation group '" + groupName + "' for text field.", textField);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:6,代码来源:TextFieldEvaluationGroupReference.java

示例8: verifyBandHeights

import net.sf.jasperreports.engine.design.JRValidationException; //导入依赖的package包/类
protected void verifyBandHeights() throws JRException
{
	if (!filler.isIgnorePagination())
	{
		int pageHeight;
		int topMargin = jasperReport.getTopMargin();
		int bottomMargin = jasperReport.getBottomMargin();
		
		JRBaseFiller parentFiller = filler;
		do
		{
			// set every time, so at the end it will be the master page height
			pageHeight = parentFiller.jasperReport.getPageHeight();
			
			// sum parent page margins
			topMargin += parentFiller.jasperReport.getTopMargin();
			bottomMargin += parentFiller.jasperReport.getBottomMargin();
			
			parentFiller = 
				parentFiller.parent != null && parentFiller.parent.getFiller() instanceof JRBaseFiller 
					? (JRBaseFiller) parentFiller.parent.getFiller() 
					: null;//FIXMEBOOK
		}
		while (parentFiller != null);
		
		List<JRValidationFault> brokenRules = new ArrayList<JRValidationFault>();
		JRVerifier.verifyBandHeights(brokenRules, 
				jasperReport, pageHeight, topMargin, bottomMargin);
		
		if (!brokenRules.isEmpty())
		{
			throw new JRValidationException("Band height validation for subreport \""
					+ jasperReport.getName() + "\" failed in the current page context "
					+ "(height = " + pageHeight + ", top margin = " + topMargin
					+ ", bottom margin = " + bottomMargin + ") : ",
					brokenRules);
		}
		else if (log.isDebugEnabled())
		{
			log.debug("Band height validation for subreport \""
					+ jasperReport.getName() + "\" succeeded in the current page context "
					+ "(height = " + pageHeight + ", top margin = " + topMargin
					+ ", bottom margin = " + bottomMargin + ")");
		}
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:47,代码来源:JRFillSubreport.java

示例9: groupNotFound

import net.sf.jasperreports.engine.design.JRValidationException; //导入依赖的package包/类
void groupNotFound(String groupName) throws JRValidationException; 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:2,代码来源:XmlGroupReference.java


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