本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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 + ")");
}
}
}
示例9: groupNotFound
import net.sf.jasperreports.engine.design.JRValidationException; //导入依赖的package包/类
void groupNotFound(String groupName) throws JRValidationException;