Image Error : java.net.MalformedURLException: no protocol

dee_jgd
dee_jgd Member
edited February 11, 2022 in Analytics #1
I added an image to the Master Page using 'Image File in shared resources'. In eclipse/preferences I set the resource folder to C:/.../configuration/.
I then set the resource file to "reportimages/logo.bmp".

The image shows up fine in the preview browser, but when I generate the report I get the following exception :

org.eclipse.birt.report.engine.layout.emitter.PageDeviceRender log
WARNING: no protocol: reportimages/logo.bmp
java.net.MalformedURLException: no protocol: reportimages/logo.bmp
at java.net.URL.<init>(URL.java:567)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at org.eclipse.birt.report.engine.emitter.pdf.PDFPage.drawImage(PDFPage.java:389)
at org.eclipse.birt.report.engine.layout.emitter.AbstractPage.drawImage(AbstractPage.java:77)
...

Any ideas?

Thanks,
Dee

Comments

  • mwilliams
    mwilliams Member
    edited December 31, 1969 #2
    Hi Dee,

    Can you attach your report design? What version of BIRT?
    Warning No formatter is installed for the format ipb
  • dee_jgd
    dee_jgd Member
    edited December 31, 1969 #3
    Hi Michael

    I'm using BIRT 2.3.2 and eclipse Ganyemede.

    I've attached the design file. This is the code used to generate the report, I suspect the error may be in here?

    public static void printPdfToDisk(ReportEngine engine, String designFileName, Map<String, String> reportParams, MimeType mimeType) {
    String outputFileName = "C:birtReportAllDeviceAlarms";
    try {
    IReportRunnable design = engine.openReportDesign(designFileName);
    IRunAndRenderTask task = engine.createRunAndRenderTask(design);

    IRenderOption options = new HTMLRenderOption();

    if (mimeType != null && mimeType.equals(MimeType.FILE_HTML)) {
    options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML);
    options.setOutputFileName(outputFileName + ".html");
    } else {
    options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF);
    options.setOutputFileName(outputFileName + ".pdf");
    }

    // code to handle images here??
    // IHTMLImageHandler htmlImageHandler = new HTMLImageHandler();
    // options.setImageHandler(htmlImageHandler);

    task.setRenderOption(options);
    task.setParameterValues(reportParams);
    task.run();
    } catch (Exception e) {
    e.printStackTrace();
    }
    }

    Thanks,
    Dee