I'm fairly new to Jasper Reports, and have been trying to create my reports using only Java code, basing it off of the noXMLDesign App that comes with the samples. One thing that isn't included, is how to add images to the report. I've added the following (see code), but when the report tries to compile, I get the following error:
"illegal start of expression"
value = (java.lang.String)(![CDATA["D:My DocumentsNetBeansProjectsSTAT 0.1buildImageslogo.jpg"]]); //$JR_EXPR_ID=12$"
Now, my question is, how do I properly set the expression for the image in Java? The expression that I wrote is what the iReport builder gave me when I added an image to the report, I just added the escape characters for quotations.
That's actually a bit of a mistake on my part. I've tried quite a few variations, and that error message didn't match the code I gave in my previous post. I added two escape backslashes in the directory to get two in the expression itself, as shown in the sample I ran through the designer. This is what it shows.
You might have to do some experimentation at this stage just to see what the parser will accept. For example try giving it a (admittedly false) path with no slashes in it at all, is that a legal expression?