try
{
for (Iterator it = stylesMap.values().iterator(); it.hasNext();)
{
JRStyle style = (JRStyle) it.next();
jasperPrint.addStyle(style);
}
}
catch (JRException e)
{
throw new JRRuntimeException(e);
}
JRStyle reportDefault = report.getDefaultStyle();
JRStyle printDefault = null;
if (reportDefault == null)
{
//search for the last default style
for (Iterator it = stylesMap.values().iterator(); it.hasNext();)
{
JRStyle style = (JRStyle) it.next();
if (style.isDefault())
{
printDefault = style;
}
}
}