if (variables != null && variables.length > 0)
{
Map groupsMap = dataset.getGroupsMap();
for(int i = 0; i < variables.length; i++)
{
JRDesignVariable variable = (JRDesignVariable)variables[i];
if (variable.getResetTypeValue() == ResetTypeEnum.GROUP)
{
String groupName = null;
JRGroup group = variable.getResetGroup();
if (group != null)
{
groupName = group.getName();
group = (JRGroup)groupsMap.get(groupName);
}
if (!ignoreConsistencyProblems && group == null)
{
throw
new JRValidationException(
"Unknown reset group '" + groupName
+ "' for variable : " + variable.getName(),
variable
);
}
variable.setResetGroup(group);
}
else
{
variable.setResetGroup(null);
}
if (variable.getIncrementTypeValue() == IncrementTypeEnum.GROUP)
{
String groupName = null;
JRGroup group = variable.getIncrementGroup();
if (group != null)
{
groupName = group.getName();
group = (JRGroup)groupsMap.get(groupName);
}
if (!ignoreConsistencyProblems && group == null)
{
throw
new JRValidationException(
"Unknown increment group '" + groupName
+ "' for variable : " + variable.getName(),
variable
);
}
variable.setIncrementGroup(group);
}
else
{
variable.setIncrementGroup(null);
}
}
}
}