use of org.pentaho.reporting.engine.classic.core.ReportDataFactoryException in project head by mifos.
the class PentahoParamParser method parseReportParams.
public List<AbstractPentahoParameter> parseReportParams(MasterReport report, HttpServletRequest request, Map<String, AbstractPentahoParameter> selectedValues, boolean update) {
ParameterContext paramContext = null;
try {
paramContext = new DefaultParameterContext(report);
ReportParameterDefinition paramDefinition = report.getParameterDefinition();
List<AbstractPentahoParameter> result = new ArrayList<AbstractPentahoParameter>();
for (ParameterDefinitionEntry paramDefEntry : paramDefinition.getParameterDefinitions()) {
result.add(parseParam(paramDefEntry, paramContext, selectedValues, update));
}
return result;
} catch (ReportDataFactoryException ex) {
throw new JNDIException("Problem with Pentaho Reports", request);
} catch (Exception ex) {
throw new MifosRuntimeException(ex);
} finally {
if (paramContext != null) {
try {
paramContext.close();
} catch (ReportDataFactoryException ex) {
logger.error("Exception while closing parameter context", ex);
}
}
}
}
use of org.pentaho.reporting.engine.classic.core.ReportDataFactoryException in project pentaho-platform by pentaho.
the class PentahoDataFactory method queryData.
@Override
public TableModel queryData(final String string, final DataRow dataRow) throws ReportDataFactoryException {
final TableModel tableModel = super.queryData(string, dataRow);
try {
final Class cls = tableModel.getClass();
final Map map = new HashMap();
String[] columnNames = dataRow.getColumnNames();
for (String columnName : columnNames) {
map.put(columnName, dataRow.get(columnName));
}
final Object[] args = { map };
final Class[] argt = { Map.class };
// $NON-NLS-1$
final Method theMethod = cls.getMethod("setParameters", argt);
if (theMethod != null) {
theMethod.invoke(tableModel, args);
}
} catch (Exception ignored) {
// Method does not exist... ok, ignore it.
}
return tableModel;
}
Aggregations