Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: jfreereport-ext-0.8.1.jar (HTML doesn't work)

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

    Default jfreereport-ext-0.8.1.jar (HTML doesn't work)

    I have not been able to get the Icons to display in the HTML report that goes with this example. Otherwise, I have fixed up this example so it works with the latest release (jfreereport-0.8.3b). I would be happy to contribute the updates, but would like to get the HTML report working first. What I found is:

    PDF-servlet -- works fine
    HTML-servlet -- works, but not icons
    First page of the JPEG Servlet -- works fine
    The complete PNG report -- I fixed this and it works

    Any help is appreciated.

    steve

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Hi,

    don't worry, you wont see them. The HTML Servlet writes its contents using the StreamHtmlFilesystem-object.

    This writer generates a single HTML stream. The writer is able to include external images (all images loaded by an http/ftp/file URL) but is (and will be) unable to include images from other sources (for instance from java.awt.Images, as in the demo). Images will only be visible if they can be included with the <IMG> tag, but as we have no files to reference to, we cannot create links to them ...

    A possible solution would be to generate the report into a ZIP or DirectoryHtmlFilesystem and to supply the generated resources by other means (for instance by an servlet, which reads the generated content and makes it referencable).

    But this is a complex, time consuming and (in 90% of the common use-cases) needless task. If you want to include external images (images stored on your server as files), then include them into your report with the help of the "image-url-element" and "image-reference" tags. And voila, you will see your images in the HTML stream.

    And yes, I have to admit that the demo is not choosen very well for that example .. But a similiar thing was implemented for the PDF and Graphics2D output, and so I just adopted it to the third servlet just to have something up and running until a better demo would be found ...

    Have more fun,
    said Thomas

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

    Default Image Tags and Adding an Image Generated by JFreeChart

    I assume you are referring to the ELEMENTs defined in "report.dtd"?

    imageref
    image-field
    imageurl-field

    Is this the DTD we are to reference?

    What is the purpose of "extreport.dtd"?

    My goal is to use the <IMG> tag to embed a chart generated by JFreeChart in the report or section header.

    steve

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

    Default After digging in the Javadoc

    OK. It looks like I use an ImageElement() and have my servlet create the ImageReferenceData() that I supply to ImageReference() ? Is there an example of what the XML to do this would look like? Thanks.

    steve

  5. #5
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Hi,

    first create a servlet, that generates the Chart-Image.

    Then embedd the image in the report by using the imageref element:

    <imageref src="http://server/path/to/our/servlet?with=optional+parameters" ...>

    This should produce the correct output for your HTML file.

    Which DTD to use depends on our report definition. Both DTDs are valid, the report.dtd is a simplified version of the JFreeReport report definition syntax.
    Documents for this DTD use the <report> tag as document root element.

    The extreport.dtd is used to describe the more complex reports, which use all of the features of JFreeReport, like stylesheets, templates and band compositions ...

    Documents for this DTD use the <report-definition> tag as document root element.

    Have mo' fun,
    said Thomas

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

    Default

    Awesome. Works like a charm. Thanks.

    steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.