}
private void verifyCrosstabBucket(JRCrosstabGroup group)
{
JRCrosstabBucket bucket = group.getBucket();
JRExpression expression = bucket.getExpression();
Class expressionClass = null;
if (expression == null)
{
addBrokenRule("Crosstab bucket expression missing for group " + group.getName() + ".", bucket);
}
else
{
try
{
expressionClass = expression.getValueClass();
if (expressionClass == null)
{
addBrokenRule("Crosstab bucket expression class missing for group " + group.getName() + ".", expression);
}
}
catch (JRRuntimeException e)
{
addBrokenRule(e, expression);
}
}
JRExpression orderByExpression = bucket.getOrderByExpression();
Class orderByClass = null;
if (orderByExpression != null)
{
try
{
orderByClass = orderByExpression.getValueClass();
if (orderByClass == null)
{
addBrokenRule("Crosstab bucket order by class missing for group "
+ group.getName() + ".", orderByExpression);
}
}
catch (JRRuntimeException e)
{
addBrokenRule(e, orderByExpression);
}
}
try
{
Class valueClass = expression == null ? null : expression.getValueClass();
if (valueClass == null)
{
addBrokenRule("Crosstab bucket value class missing for group " + group.getName() + ".", bucket);
}
else if (expressionClass != null && !valueClass.isAssignableFrom(expressionClass))
{
addBrokenRule("The class of the expression is not compatible with the class of the crosstab bucket for group " + group.getName() + ".", expression);
}
JRExpression comparatorExpression = bucket.getComparatorExpression();
if (comparatorExpression == null)
{
if (orderByExpression == null)
{
// no order by expression, bucket values are used for sorting