subreport.setParametersMapExpression(ExpressionUtils.getParameterExpression(sr));
for (Iterator subreportParamsIter = sr.getParameters().iterator(); subreportParamsIter.hasNext();) {
SubreportParameter srparam = (SubreportParameter) subreportParamsIter.next();
JRDesignSubreportParameter subreportParameter = new JRDesignSubreportParameter();
subreportParameter.setName(srparam.getName());
JRExpression expression2 = ExpressionUtils.createExpression(getDesign(), srparam);
subreportParameter.setExpression(expression2);
try {
subreport.addParameter(subreportParameter );
} catch (JRException e) {
log.error("Error registering parameter for subreport, there must be another parameter with the same name");