PDA

View Full Version : Problem with the images



Anonymous
06-03-2002, 07:01 AM
I can preview only one time when I view a report that includes a image. After the preview, I can't preview another time. Why??
Thanks,
Excuse me for my poor english,

Anonymous
06-03-2002, 07:15 AM
Hi,

this behavour is not intended, a bug!, so I have a couple of questions so we can track down and reproduce the problem.

When defining the image, what kind of image do you use (gif, jpeg, wmf, or AWT-Image which is not loaded from a file/url)? What happens when the preview failed (any exceptions?), messages or strange behaviour? And how did you create the report, compositing everything manually or using the xml-parser?

Awaiting your answer, and until then
Have more fun,

said Thomas

Anonymous
06-04-2002, 02:19 AM
I've observed that the problem is with the images different to format WMF. The error message is (when load the preview in second time):
DEBUG: Loading: null image001.gif as image
Thanks,

Anonymous
06-04-2002, 06:33 AM
The log message you decribe is created by the parser's element factory when creating an image element. It says, that the parser tries to load a image called "image001.gif" from the (here non-existent) contentbase.

The parser's contentbase is defined when you call the ParserGenerator.
In case you start parsing with a file name (either as file or as String), then the content base will be the directory where your report definition is loaded from.

If you load your report from a single URL, (parseReport(URL)), the current url is your contentbase. To specifiy a different contentbase, you should use
parseReport(URL file, URL contentBase).

When you specify a relative url/filename in a report definition, the contentbase is used to complete the locationname to an absolute name. This is the same behaviour as done with applets. Combining the urls is done using "new URL (parent, relativeURL)" and the same rules apply.

The propagation and creation of a valid contentbase was not really working for version 0.7.2, so use the current cvs version to check, whether this bug still exits.

As I'm currently far away from the sources, I'm currently unable to perform additional checks, so you may have to experiment a little bit :)

Have more fun,
said Thomas

Anonymous
06-04-2002, 05:40 PM
Now I know that you must be using an older version. I just tried to akter the report3 to load an png. Direct loading by giving the complete URL of
http://www.object-refinery.com/jfreereport/images/glyphs.png worked, but for the filesystem test I copied it in the wrong directory and I got a big bad FileNotFoundException :)

So just upgrade to the latest CVS version and your problems should be gone.

Have more fun,
said Thomas

Anonymous
06-05-2002, 02:04 AM
I'm sorry, but I use the latest version (0.7.2). I execute your example (report3.xml) with anim0002.wmf and all is correct. However, if I use another image of distinct format (by example: *.jpg) of the same directory, the jFreeReport crash.
Thanks,

Anonymous
06-05-2002, 03:01 AM
But have you downloaded the package (jar-file) (evil, this is the old and buggy one) or have you checked out the sources from the cvs (good, here are these bugs fixed).

0.7.2 is almost outdated, 0.7.3 is on the way and gets released next week. The plan is to release it on monday, at least when no major flaws are detected during the next days. The days 'til then are filled with writing documentation and test cases, but all functionality for this release is implemented and there are no obvious errors/bugs known in the current code yet.

So I would suggest you checkout the latest sources and use them instead of the older packages.

Have more fun,
said Thomas