US and Worldwide: +1 (866) 660-7555
Results 1 to 2 of 2

Thread: Embedding an image into the report

  1. #1
    Join Date
    Mar 2003
    Posts
    4,947

    Default Embedding an image into the report

    Hi,
    We have an application in which we want to generate the graphs using
    JFreeChart-0.9.6. Then save this graph as a JPEG and now i want to append that graph in the report using JFreeReport0.8.1_02. Here i need to clarify some things.
    Can i generate a report which i would like to export as an PDF file containing the graph generated by JfreeChart and the tables from the JfreeReport?

    If i could do that it would be very helpful if somebody could give me a brief description on how this can be done.

    Thanks in advance

  2. #2
    Join Date
    Mar 2003
    Posts
    7,560

    Default

    Hi,

    If the JPEG data is stored in a file, then you can simply reference this file (as done in report3.xml with the WMF-File).

    If you generate your Chart during the report processing, then it would be more easier to return/fill a java.awt.Image into an ImageElement. The image will be automaticly encoded as PNG and included in the PDF-File, you don't have to do anything else

    If your chart is generated in a function, then simply return an Image, if your chart is generated somewhere else, you have the choice to either put the image in the TableModel or to use the report properties to access the image.

    Have a look at this thread to see how images can be included in the report properties.
    http://forums.pentaho.org/showthread.php?t=31183

    The demo "OpenSourceDemo.java" also shows the use of ReportProperties in conjunction with Images.

    Important: Please upgrade to the latest version to get the Image-Not-Drawn-Bug fixed (the one mentioned in the thread above).

    Have more fun,
    said Thomas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •