{"record":{"id":"83a9fbf4c3360780","repo":"pentaho/pentaho-kettle","slug":"unable-to-draw-image-onto-report","errorCode":null,"errorMessage":"Unable to draw image onto report","messagePattern":"Unable to draw image onto report","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/autodoc/TransJobDrawable.java","lineNumber":46,"sourceCode":"\n  public TransJobDrawable( Bowl bowl, ReportSubjectLocation location, boolean pixelateImages ) {\n    this.bowl = bowl;\n    this.location = location;\n    this.pixelateImages = pixelateImages;\n  }\n\n  @Override\n  public void draw( Graphics2D graphics2D, Rectangle2D rectangle2D ) {\n    try {\n      if ( location.isTransformation() ) {\n        TransformationInformation ti = TransformationInformation.getInstance();\n        ti.drawImage( bowl, graphics2D, rectangle2D, location, pixelateImages );\n      } else {\n        JobInformation ji = JobInformation.getInstance();\n        ji.drawImage( bowl, graphics2D, rectangle2D, location, pixelateImages );\n      }\n    } catch ( Exception e ) {\n      throw new RuntimeException( \"Unable to draw image onto report\", e );\n    }\n  }\n\n  /**\n   * @return the pixelateImages\n   */\n  public boolean isPixelateImages() {\n    return pixelateImages;\n  }\n\n  /**\n   * @param pixelateImages\n   *          the pixelateImages to set\n   */\n  public void setPixelateImages( boolean pixelateImages ) {\n    this.pixelateImages = pixelateImages;\n  }\n}","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/autodoc/TransJobDrawable.java#L28-L64","documentation":"TransJobDrawable.draw renders a transformation or job image into a report's Graphics2D context. Any exception thrown during drawing (by TransInformation/JobInformation.drawImage) is caught and rethrown as a RuntimeException with this message, which aborts report generation.","triggerScenarios":"Calling draw during report build when the referenced transformation/job (by location) cannot be loaded or its layout cannot be computed — missing file, unparseable metadata, or Graphics2D drawing failure.","commonSituations":"The .ktr/.kjb file referenced by the AutoDoc step was moved/renamed, the file fails to load due to XML errors, or the target rectangle is degenerate causing drawing to fail.","solutions":["Verify the transformation/job file path configured in the AutoDoc step exists and is readable.","Open the referenced .ktr/.kjb in Spoon to confirm it loads without errors.","Check the wrapped cause (e.getCause()) to identify the exact drawing/loading failure.","Update the report area size/rectangle if the image does not fit.","Regenerate the AutoDoc step configuration pointing to a valid metadata file."],"exampleFix":"// before\nString location = environmentSubstitute(meta.getFilename()); // may not exist\n// after\nFile f = new File(environmentSubstitute(meta.getFilename()));\nif (!f.canRead()) throw new KettleException(\"Referenced job/trans not readable: \" + f);","handlingStrategy":"validation","validationCode":"// before building the report\nString path = environmentSubstitute(meta.getFilename());\njava.io.File f = new java.io.File(path);\nif (!f.isFile() || !f.canRead()) {\n  throw new IllegalStateException(\"Drawable job/trans not readable: \" + path);\n}","typeGuard":null,"tryCatchPattern":"try {\n  drawable.draw(bowl, g2d, rect, location, pixelate);\n} catch (RuntimeException e) {\n  log.error(\"draw failed: \" + e.getCause(), e);\n  // skip the image area instead of failing the whole report\n}","preventionTips":["Verify referenced .ktr/.kjb paths exist and load in Spoon before running autodoc.","Use variables consistently and ensure they resolve at runtime.","Check e.getCause() for the true drawing failure.","Keep report area rectangles non-degenerate (positive width/height)."],"tags":["kettle","reporting","drawing"],"backgroundTag":"file-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"}