Class OpenSourceAPIDemoHandler

  • All Implemented Interfaces:
    DemoHandler, InternalDemoHandler

    public class OpenSourceAPIDemoHandler
    extends AbstractDemoHandler
    This demo application replicates the report generated by OpenSourceXMLDemoHandler.java, but creates the report in code rather than using an XML report template.
    Author:
    David Gilbert
    • Constructor Detail

      • OpenSourceAPIDemoHandler

        public OpenSourceAPIDemoHandler()
    • Method Detail

      • getPresentationComponent

        public JComponent getPresentationComponent()
        Description copied from interface: InternalDemoHandler
        Returns the presentation component for this demo. This component is shown before the real report generation is started. Ususally it contains a JTable with the demo data and/or input components, which allow to configure the report.
        Returns:
        the presentation component, never null.
      • getDemoDescriptionSource

        public URL getDemoDescriptionSource()
        Description copied from interface: InternalDemoHandler
        Returns the URL of the HTML document describing this demo.
        Returns:
        the demo description.
      • getDemoName

        public String getDemoName()
        Description copied from interface: InternalDemoHandler
        Returns the display name of the demo.
        Returns:
        the name.
      • createReport

        public org.pentaho.reporting.engine.classic.core.MasterReport createReport()
                                                                            throws ReportDefinitionException
        Description copied from interface: InternalDemoHandler
        Creates the report. For XML reports, this will most likely call the ReportGenerator, while API reports may use this function to build and return a new, fully initialized report object.
        Returns:
        the fully initialized JFreeReport object.
        Throws:
        ReportDefinitionException - if an error occured preventing the report definition.
      • createStaticReport

        public static org.pentaho.reporting.engine.classic.core.MasterReport createStaticReport()
        Creates a report definition in code.

        It is more base to read the definition from an XML report template file, but sometimes you might need to create a report dynamically.

        Returns:
        a report.