{
scaleCellElement(element, originalWidth, width);
if (element instanceof JRElementGroup)//i.e. frame
{
JRElementGroup elementGroup = (JRElementGroup) element;
for (JRElement subelement : elementGroup.getElements())
{
scaleCellElement(subelement, originalWidth, width);
}
}
}
frame.addElement(element);
}
else if (child instanceof JRElementGroup)
{
JRElementGroup elementGroup = (JRElementGroup) child;
// clone the elements in order to set the frame as group
elementGroup = (JRElementGroup) elementGroup.clone(frame);
frame.addElementGroup(elementGroup);
if (width != originalWidth)
{
for (JRElement element : elementGroup.getElements())
{
scaleCellElement(element, originalWidth, width);
}
}
}