The Artima Developer Community
Sponsored Link

Java Answers Forum
[BIRT] Don't load an element

1 reply on 1 page. Most recent reply: Jul 3, 2006 11:05 PM by Matthias Neumair

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Bérénice MAUREL

Posts: 1
Nickname: bim
Registered: Jul, 2006

[BIRT] Don't load an element Posted: Jul 3, 2006 7:20 AM
Reply to this message Reply
Advertisement
Hello !

I list some persons and I would like to post the photo. In the database, that's the path to the photo which is copied in a field of my DataSet (row["Photo"]). This path is well copied and I show the photo.

But, sometimes, the field photo in the DataBase is empty. Then I would like to not load the image when this field is empty (or row["Photo"]).

How can I do that please ?

When I load an empty image, I have this message :
GRAVE: can't retrieve image intrinsic dimension!
3 juil. 2006 11:43:17 org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter drawImage
ATTENTION: C:\jakarta-tomcat-4.1.31\bin\row["Photo"] (Syntaxe du nom de fichier, de répertoire ou de volume incorrecte)
java.io.FileNotFoundException: C:\jakarta-tomcat-4.1.31\bin\row["Photo"] (Syntaxe du nom de fichier, de répertoire ou de volume incorrecte)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
[...]
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:6 83)
at java.lang.Thread.run(Thread.java:534)

Thanks for your answers !

PS : Sorry for my english, I'm french ;o)


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: [BIRT] Don't load an element Posted: Jul 3, 2006 11:05 PM
Reply to this message Reply
    String imagePath = ... //read from DB or wherever you get the information from
    if (imagePath != null) {
        java.io.File imageFile = new java.io.File(imagePath);
        if (imageFile.exists() && !imageFile.isDirectory()) {
            //load your image here
        }
    }
 

Flat View: This topic has 1 reply on 1 page
Topic: purchase Previous Topic   Next Topic Topic: Easy money

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use