Image Error : java.net.MalformedURLException: no protocol
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
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
0
Comments
-
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,
Dee0
Categories
- All Categories
- 121 Developer Announcements
- 52 Articles
- 148 General Questions
- 146 Thrust Services
- 56 OpenText Hackathon
- 35 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 917 Cloud Fax and Notifications
- 83 Digital Asset Management
- 9.4K Documentum
- 30 eDOCS
- 178 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 7 XM Fax