Package org.eclipse.birt.report.engine.api
A report engine supports running several types of task. Examples are GetParameterDefinitionTask, RunAndRenderReportTask, etc. To run and render a report, the following steps may be involved:
- The report design is opened by calling the ReportEngine.openReportDesign(...) The method returns an IReportRunnable object.
- With the IReportRunnable object, call ReportEngine.createGetParameterDefinitionTask(...) to obtain an IGetParameterDefinitionTask object, from which parameter definitions are retrieved. A UI page can be constructed based on the definitions to prompt end users for parameter values.
- An IRunReportTask object can be obtained by calling ReportEngine.createRunAndRenderReportTask(...). From the task, report parameters are set. Running options can also be set.
- The run() method on IRunAndRenderReportTask is called.
Simple Use of Report Engine, No Customization
To get a report to run, do the following:
ReportEngine engine = new ReportEngine(null);
IReportRunnable design = engine.openReportDesign("C:/temp/test.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
IOutputSetting setting = new OutputSetting();
setting.setOutputFileName("C:/temp/test.html");
task.setOutputSetting(setting);
task.run();
No customization is done so engine will asserts its default behavior: write the report to HTML format at C:/temp/test.html, assuming JVM locale. The report design can not contain images, charts ot hyperlinks, or otherwise engine has to be configured with corresponging image or action handlers. It is also assumed that test.rptdesign does not have parameters, so no GetParameterDefinition task is constructed.
Using Report Engine with Customization
The following example customizes the engine:
// Engine configuration
EngineConfig config = new EngineConfig();
config.setEngineHome("C:/birt/"); // Configuring where BIRT engine is installed
config.setImageHandler(new MyImageHandler(...)); // You define and instantiate class MyImageHandler
config.setActionHandler(new MyActionHandler(...)); // You define and instantiate class MYActionHandler
config.addScriptableJavaObject("foo", aFooinstance);// You can now write foo.bar() in your report
// Create engine and open report design
ReportEngine engine = new ReportEngine(config); //Create engine with configuration
IReportRunnable design = engine.openReportDesign("C:/temp/test.rptdesign");
// Get parameter definitions
IGetParameterDefinitionTask task = engine.createGetParameterDefinitionTask(design);
task.setLocale(myLocale); // set rendering locale
Collection parameters = task.getParameterDefns(false); // get parameter definitions
// Present parameter prompt page and receive inputs.
// Create task to run and render the report
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
// Set parameters
task.setParameters(parameterMap); // parameterMap is a hash map of parameter name/value pairs
task.setLocale(myLocale);
// output options
XHTMLOutputSetting setting = new XHTMLOutputSetting(); // assume this is a third-party format
setting.setOutputFileName("C:/temp/test.html");
setting.setOutputFormat("xhtml"); // XHTML emitter supports "xhtml" format
setting.setEmbeddable(true); // XHTML also supports embeddable
task.setOutputSetting(setting);
task.run();
Package Specification
Application-writer's interface for the BIRT Engine.
- Since:
- 1.0
-
ClassDescriptionCached Image Created by the IHTMLImageHandler.a class that wraps around an identifier for a report componentSpecify the compression mode to generate ooxml file.the data id of the data used by an instance.ID represent the data set.default implementation for a status handler.Render option of docx outputThe descriptor of the plugin emitter.Wraps around configuration settings for report engine.Defines various constants that engine host may need to useDefine an engine exception that clients of the engine need to handle.Defines a default action handler for HTML output formatDefault implementation for writing images in a form that is compatible with a web browser's "HTML Complete" save option, i.e., writes images to a predefined folder.Deprecated.since 2.2, use HTMLRenderOption or RenderOption directlyDeprecated.set the property to RenderOption directly.output settings for HTML output formatDefault implementation for writing images in a form that is used in a web-application.Defines an interface that allows engine to pass hyperlink information to an emitter, if the emitter determines to customize the hyperlinks calculated in engine, or it wants to use a totally different hyperlink stringData Action is used to generate a URL used to reterive the data from the data base.an engine task that extracts data from a report.An iterator on a result set from a prepared and executed query.defines common features for an engine task.A handle used to retrieve data stored in a report.an engine task that retrieves parameter definitions from a report.Defines an interface for action handler used in HTML formatDefines the image handler interface for use in HTML formatInterface of constants of the HTML Render Opitons.Defines an interface to communicate info about an image to image handlerClass of image sizea class that wraps around an identifier for a report element instanceAn interface implemented by app developer to provide handler after each page is generated in factoery.base interface for a BIRT report parameterCaptures properties shared by all types of parameters and parameter group, i.e., name, display name, help text and custom-defined properties.The interface for objects which visually groups report parameters.defines one choice in a parameter selction value listDefines render options for PDF emitter.This interface is to trace the progress of BIRT.Defines render options for emittersAn engine task that renders a Report Document to one of the output formats supported by the engine.A report document (i.e., not modifiable) that can be rendered to other formats in the BIRT presentation engine This is the high-level report document interface.the interface used to access the traisent informations of a report document.lock used to lock the report document.A report engine provides an entry point for reporting functionalities.a factory used to create the Report Engine.Base interface that provides accessible information for a report partA runnable report design (i.e., not modifiable) that can be run in the BIRT engineDescribes the metadata of a detail row in an IResultIterator.an engine task that runs a report and renders it to one of the output formats supported by the engine.An engine task that runs a report and generates a report document.Defines a scalar parameterInterface that defines several status handler callback functions.Define the interface of task optionsRepresents a whole TOC tree.Deprecated.set the option to RenderOption directly.Defines render options for emittersSettings for rendering a report to an output format.Deprecated.use RenderOption insteadThis is a wrapper class for the IReportEngine.Utilites class to convert report paramete value between object and string.Defines a standalone reporting application that uses
StandaloneReportEngine
class.Define the class of task optionsA node that wraps around a TOC entry.Definition of the TOC styles