From 619ec9e8cca9c90db051e487b7a991ad672ab0e0 Mon Sep 17 00:00:00 2001 From: John Woodlock Date: Thu, 7 Mar 2013 11:42:44 +0000 Subject: [PATCH] all Long data type for pentaho reports to cater for database ids --- .../dataqueries/service/ReadReportingServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/service/ReadReportingServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/service/ReadReportingServiceImpl.java index 5508871fe..7fec70f69 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/service/ReadReportingServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/service/ReadReportingServiceImpl.java @@ -323,7 +323,7 @@ public class ReadReportingServiceImpl implements ReadReportingService { ReportParameterDefinition paramsDefinition = report.getParameterDefinition(); /* - * only allow integer and string parameter types and assume all + * only allow integer, long, date and string parameter types and assume all * mandatory - could go more detailed like Pawel did in Mifos later * and could match incoming and pentaho parameters better... * currently assuming they come in ok... and if not an error @@ -337,9 +337,10 @@ public class ReadReportingServiceImpl implements ReadReportingService { Class clazz = paramDefEntry.getValueType(); logger.info("addParametersToReport(" + paramName + " : " + pValue + " : " + clazz.getCanonicalName() + ")"); - if (clazz.getCanonicalName().equalsIgnoreCase("java.lang.Integer")) rptParamValues.put(paramName, Integer.parseInt(pValue)); + else if (clazz.getCanonicalName().equalsIgnoreCase("java.lang.Long")) + rptParamValues.put(paramName, Long.parseLong(pValue)); else if (clazz.getCanonicalName().equalsIgnoreCase("java.sql.Date")) rptParamValues.put(paramName, Date.valueOf(pValue)); else