With Pentaho Reporting's API, it is possible to implement your own report elements. In this section, you'll walk through the necessary steps to implement a basic report element. You'll learn how to define an ElementType
, XML read and write handlers, as well as all the metadata necessary to have your report element appear in the Report Designer.
The first step in defining a new report element is implementing the ElementType
interface, located in the org.pentaho.reporting.engine.classic.core.metadata package
. This interface defines a set of methods that allow the creation and rendering of an element within a report.
// the getMetaData method returns the element type's // metadata, including the element name, attributes and styles public ElementMetaData getMetaData(); // Inherited from the DataSource interface, the getValue // method generates a renderable object that will appear // in a report. public Object getValue(final ExpressionRuntime...