2002 JI Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 By: LuxCed - luxced pdf with images loaded via URL 2003-08-29 06:32 Hi All, I have a problem trying to convert a report in pdf. I've a table, on my DB, with a field containing an URL that points to an image (jpg) placed on a web server. I can fill the report, and If I run the view task, everything is ok (I can see the images loaded). But when I try to convert the report with pdf task, I obtain this message: pdf: [java] java.io.IOException: java.awt.Image fetch aborted or errored [java] at com.lowagie.text.Image.getInstance(Unknown Source) [java] at com.lowagie.text.Image.getInstance(Unknown Source) [java] at dori.jasper.engine.export.JRPdfExporter.exportImage(JRPdfExpo rter.java:876) [java] at dori.jasper.engine.export.JRPdfExporter.exportPage(JRPdfExpor ter.java:387) [java] at dori.jasper.engine.export.JRPdfExporter.exportReportToStream( JRPdfExporter.java:340) [java] at dori.jasper.engine.export.JRPdfExporter.exportReport(JRPdfExp orter.java:262) [java] at dori.jasper.engine.JasperExportManager.exportReportToPdfFile( JasperExportManager.java:140) [java] at dori.jasper.engine.JasperExportManager.exportReportToPdfFile( JasperExportManager.java:106) [java] at QueryApp.main(QueryApp.java:164) [java] NESTED BY : [java] dori.jasper.engine.JRException: Error generating PDF report : QueryR eport [java] at dori.jasper.engine.export.JRPdfExporter.exportReportToStream( JRPdfExporter.java:353) [java] at dori.jasper.engine.export.JRPdfExporter.exportReport(JRPdfExp orter.java:262) [java] at dori.jasper.engine.JasperExportManager.exportReportToPdfFile( JasperExportManager.java:140) [java] at dori.jasper.engine.JasperExportManager.exportReportToPdfFile( JasperExportManager.java:106) [java] at QueryApp.main(QueryApp.java:164) [java] Java Result: 1 BUILD SUCCESSFUL Total time: 6 seconds This is the code of the report: <image scaleImage="RetainShape"> <reportElement x="200" y="4" width="30" height="20"/> <graphicElement pen="Thin"/> <imageExpression>$F{DEFORGURL}</imageExpression> </image> where DEFORGURL is a field readed from a table with a query. It's a String field with value like: http://aaaa.bbb.ccc/blabla/aaa.jpg If I change the report xml, pointing <imageExpression> to a file on my local disk, the pdf task is ok. I'm using JasperReports 0.4.6. Could you help me? TIA Matteo By: LuxCed - luxced RE: pdf with images loaded via URL 2003-08-29 07:54 Maybe I guess the problem. If I avoid to load (in the query) the field DEFORGURL with value = '' then it works! So my question is: is it possible to determine at runtime (fill) the value of a field, so I can choose what to do? For example, how can I write the construct: <condition ? value if true : value if false> inside the <imageExpression> tag? Thanks By: Gary Hill - gary_hill94 RE: pdf with images loaded via URL 2003-09-02 05:11 I believe this should work: <imageExpression> new java.awt.Image((condition) ? value if true : value if false) </imageExpression> Gary Hill By: Renardo Tyner - rtyner RE: pdf with images loaded via URL 2003-10-03 07:00 Where you able to get images loaded successfully via URL. If so, could you explain how it was done? Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now