use of org.pentaho.reporting.libraries.base.config.ModifiableConfiguration in project pentaho-platform by pentaho.
the class JFreeReportConfigParameterComponent method setReportConfigParameters.
private void setReportConfigParameters(final MasterReport report, final IPentahoResultSet values) {
int rowCount = values.getRowCount();
int colCount = values.getColumnCount();
ModifiableConfiguration config = report.getReportConfiguration();
if (colCount >= 2) {
IPentahoMetaData md = values.getMetaData();
// $NON-NLS-1$
int nameIdx = md.getColumnIndex("name");
// $NON-NLS-1$
int valIdx = md.getColumnIndex("value");
if (nameIdx < 0) {
nameIdx = 0;
}
if (valIdx < 0) {
valIdx = 1;
}
for (int i = 0; i < rowCount; i++) {
Object[] aRow = values.getDataRow(i);
if ((aRow[nameIdx] != null) && (aRow[valIdx] != null)) {
config.setConfigProperty(aRow[nameIdx].toString(), applyInputsToFormat(aRow[valIdx].toString()));
}
}
} else {
// $NON-NLS-1$
error(Messages.getInstance().getErrorString("JFreeReport.ERROR_0025_INVALID_REPORT_CONFIGURATION_PARAMETERS"));
}
}
Aggregations