Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

Pentaho Reporting comes with two flavours of XML definition formats. The Simple-XML format has been designed to be used by humans. It has a very simple structure and covers most of Pentaho Reporting's featureset. It is safe to say that 95% of all developers will not need the remaining feature set.  The Extended Report Definition Format is an XML-based serialization format for Pentaho Reporting. It is not meant to be edited by humans and its structure resembles the internal data structures of Pentaho Reporting. It is possible to create Extended Report Definition documents from any Pentaho Reporting object. The report-writer module contains all code necessary to serialize the object into a valid XML-stream.

The reference documents for the extended report definition format can be generated by starting the java class

org.jfree.report.modules.misc.referencedoc.ReferenceDocGenerator

or by starting the misc-referencedoc module with

java -jar jfreereport-misc-referencedoc-0.8.7-4.jar

The reference manual documents all currently defined StyleKeys and the object definitions used in the stylekeys and when defining templates or datasources.

/**
 * Parses a report and displays a non-modal preview dialog.
 *
 * @param in the URL to the Report Definition XML file
 * @param data a valid tablemodel.
 */
public void executeReport (URL in, TableModel data)
  throws ReportDefinitionException
{
  if (in == null)
  {
    throw new ReportDefinitionException("URL is invalid");
  }

  try
  {
    final ReportGenerator generator = ReportGenerator.getInstance();
    JFreeReport report = generator.parseReport(in);
    report.setData (data);

    final PreviewDialog frame = new PreviewDialog(report);
    frame.pack();
    RefineryUtilities.positionFrameRandomly(frame);
    frame.setVisible(true);
  }
  catch(Exception e)
  {
    throw new ReportDefinitionException("Parsing failed", e);
  }
}


  • No labels