{"record":{"id":"74a9313a53e153df","repo":"pentaho/pentaho-kettle","slug":"pentahoreportingoutput-exception-cannotfindfield","errorCode":null,"errorMessage":"PentahoReportingOutput.Exception.CanNotFindField","messagePattern":"PentahoReportingOutput\\.Exception\\.CanNotFindField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pentaho-reporting/impl/src/main/java/org/pentaho/di/trans/steps/pentahoreporting/PentahoReportingOutput.java","lineNumber":242,"sourceCode":"      Thread.currentThread().setContextClassLoader( PentahoReportingOutput.class.getClassLoader() );\n\n      try {\n\n        // Load the master report from the PRPT\n        //\n        MasterReport report = loadMasterReport( getTransMeta().getBowl(), sourceFilename, getTrans() );\n\n        // Set the parameters values that are present in the various fields...\n        //\n        ReportParameterValues values = report.getParameterValues();\n        ReportParameterDefinition definition = report.getParameterDefinition();\n\n        for ( String parameterName : meta.getParameterFieldMap().keySet() ) {\n          String fieldName = meta.getParameterFieldMap().get( parameterName );\n          if ( fieldName != null ) {\n            int index = getInputRowMeta().indexOfValue( fieldName );\n            if ( index < 0 ) {\n              throw new KettleException( BaseMessages.getString(\n                PKG, \"PentahoReportingOutput.Exception.CanNotFindField\", fieldName ) );\n            }\n\n            Class<?> clazz = findParameterClass( definition, parameterName );\n            Object value = null;\n            if ( clazz != null ) {\n              if ( clazz.equals( String.class ) ) {\n                value = getInputRowMeta().getString( r, index );\n              } else if ( clazz.equals( String[].class ) ) {\n                value = getInputRowMeta().getString( r, index ).split( \"\\t\" );\n              } else if ( clazz.equals( Date.class ) ) {\n                value = getInputRowMeta().getDate( r, index );\n              } else if ( clazz.equals( byte.class ) || clazz.equals( Byte.class ) ) {\n                value = getInputRowMeta().getInteger( r, index ).byteValue();\n              } else if ( clazz.equals( Short.class ) || clazz.equals( short.class ) ) {\n                value = getInputRowMeta().getInteger( r, index ).shortValue();\n              } else if ( clazz.equals( Integer.class ) || clazz.equals( int.class ) ) {\n                value = getInputRowMeta().getInteger( r, index ).intValue();","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pentaho-reporting/impl/src/main/java/org/pentaho/di/trans/steps/pentahoreporting/PentahoReportingOutput.java#L224-L260","documentation":"PentahoReportingOutput.processReport() maps report parameters to input stream fields via meta.getParameterFieldMap(). For each parameter whose mapped fieldName is non-null it looks up the column in the input row metadata; if not found it throws 'PentahoReportingOutput.Exception.CanNotFindField' (resolved message 'Field {0} could not be found in the input rows.').","triggerScenarios":"Executing the reporting step when a parameter-field mapping references a column name that the incoming rows no longer contain (renamed/deleted upstream, wrong case, or the mapping was hand-typed).","commonSituations":"Report parameters defined against an older stream layout; upstream filter/select step dropped the parameter column; typo in the field name entered in the parameters table.","solutions":["Edit the step's Parameters table so each mapped field name matches an actual column of the incoming stream exactly.","Fix the upstream step to still emit the parameter columns.","Refresh the input fields via 'Get Fields' and reselect from the dropdown instead of typing names.","Remove parameter mappings for fields that no longer exist."],"exampleFix":"// before\nparameterFieldMap.put(\"REPORT_DATE\", \"date_col\"); // stream now has \"reportDate\"\n// after\nparameterFieldMap.put(\"REPORT_DATE\", \"reportDate\");","handlingStrategy":"validation","validationCode":"for (Map.Entry<String, String> e : meta.getParameterFieldMap().entrySet()) {\n  String fieldName = e.getValue();\n  if (fieldName != null && inputRowMeta.indexOfValue(fieldName) < 0) {\n    throw new IllegalStateException(\"parameter \" + e.getKey() + \" maps to missing field: \" + fieldName);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow();\n} catch (KettleException ex) {\n  if (ex.getMessage().contains(\"CanNotFindField\")) {\n    // correct the parameter-to-field mapping in the step settings\n  } else { throw ex; }\n}","preventionTips":["Map report parameters only to columns selected from the stream field list.","Re-check parameter mappings whenever the upstream stream changes.","Remove stale mappings for retired parameters/fields."],"tags":["kettle","reporting","parameter-mapping","field-mapping","processreport"],"backgroundTag":"record-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}