當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。