dateformat = dateformat.replaceAll("D", "d");
dateformat = dateformat.replaceAll("m", "M");
dateformat = dateformat.replaceAll("Y", "y");
}
JRParameter[] reportParameters = report.getParameters();
ParametersDecoder decoder = new ParametersDecoder();
for (int i = 0; i < reportParameters.length; i++) {
JRParameter aReportParameter = reportParameters[i];
String paramName = aReportParameter.getName();
logger.debug("Examining parameter with name [" + paramName + "] ...");
String paramValueString = null;
if(parameters.get(paramName) instanceof String ){
paramValueString=(String) parameters.get(paramName);
}
if (paramValueString == null) {
logger.debug("No value found for parameter with name [" + paramName + "]");
continue;
}
if (paramValueString != null) {
logger.debug("Value found for parameter with name [" + paramName + "] is [" + paramValueString + "]");
/*
* The ParameterConverter converts a single value. Multi-value
* parameters are assumed to contains values that are String type.
* If they are not Strings (list of dates, list of numbers, ...) the
* converter will not work.
*/
if (decoder.isMultiValues(paramValueString)) {
logger.debug("Value found for parameter with name [" + paramName + "] is [" + paramValueString + "] and it is multivalue. " +
"Cannot adapt parameter nature");
continue;
}
Class aReportParameterClass = aReportParameter.getValueClass();