Class ReportEngine
java.lang.Object
org.eclipse.birt.report.engine.api.ReportEngine
- All Implemented Interfaces:
IReportEngine
This is a wrapper class for the IReportEngine. The new user should use the
IReportEngineFactory to create the IReportEngine instead of use this class
directly.
- See Also:
-
org.eclipes.birt.report.engine.api.ReportRunner
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IReportEnginethe report engine.protected static Loggerthe logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeLogLevel(Level newLevel) Change the log level to newLevelcreateDataExtractionTask(IReportDocument reportDocument) creates a task that allows data extraction from a report documentcreateEngineTask(String taskName) create an engine taskcreateGetParameterDefinitionTask(IReportRunnable reportRunnable) creates an engine task for obtaining report parameter definitionscreateGetParameterDefinitionTask(IRunnable reportRunnable) creates an engine task for obtaining report parameter definitionscreateRenderTask(IReportDocument reportDocument) creates a task that renders the report to a specific output format.createRenderTask(IReportDocument reportDocument, IReportRunnable reportRunnable) create a task that renders the report to a specific output format.createRunAndRenderTask(IReportRunnable reportRunnable) creates an engine task for running and rendering report directly to output formatcreateRunTask(IReportRunnable reportRunnable) creates a task to run a report to generate a report documentvoiddestroy()shuts down the report enginereturns the engine configuration objectReturns data extraction extension information.Return all the emitter information which BIRT Engine can load.get the logger used by report enginegetMIMEType(String format) the MIME type for the specific formatted supported by the extension.get the root scope used by the engineString[]returns all supported output formats through BIRT engine emitter extensionsget the BIRT versionopenDocumentWriter(org.eclipse.birt.core.archive.compound.IArchiveFile file) creates a document writer that can write this archive fileopenReportDesign(InputStream designStream) opens a report design stream and creates a report design runnable.openReportDesign(String designName) opens a report design file and creates a report design runnable.openReportDesign(String name, InputStream designStream) opens a report design stream and creates a report design runnable.openReportDesign(String name, InputStream designStream, Map options) open the report design and return the runnableopenReportDesign(String name, InputStream designStream, org.eclipse.birt.report.model.api.IResourceLocator locator) opens a report design stream and creates a report design runnable.openReportDesign(String designName, org.eclipse.birt.report.model.api.IResourceLocator locator) opens a report design file and creates a report design runnable.openReportDesign(org.eclipse.birt.report.model.api.ReportDesignHandle designHandle) opens a report designHandle and creates a report design runnable.openReportDocument(String fileName) opens a report document and returns an IReportDocument object, from which further information can be retrieved.openReportDocument(String systemId, String fileName) opens a report document and returns an IReportDocument object, from which further information can be retrieved.openReportDocument(String systemId, String fileName, Map options) opens a report document and returns an IReportDocument object, from which further information can be retrieved.openReportDocument(String systemId, String fileName, org.eclipse.birt.report.model.api.IResourceLocator locator) opens a report document and returns an IReportDocument object, from which further information can be retrieved.openReportDocument(String systemId, org.eclipse.birt.core.archive.IDocArchiveReader reader, Map options) opens a report document and returns an IReportDocument object, from which further information can be retrieved.openReportDocument(String fileName, org.eclipse.birt.report.model.api.IResourceLocator locator) opens a report document and returns an IReportDocument object, from which further information can be retrieved.voidset the logger used by report engine.voidshutdown()Deprecated.
-
Field Details
-
logger
the logger -
engine
the report engine.
-
-
Constructor Details
-
ReportEngine
Constructor. If config is null, engine derives BIRT_HOME from the location of the engine jar file, and derives data driver directory as $BIRT_HOME/drivers. For a simple report with no images and links, engine will run without complaining. If the report has image/chart defined, the engine has to be configured with relevant image and chart handlers.- Parameters:
config- an engine configuration object used to configure the engine
-
-
Method Details
-
getRootScope
get the root scope used by the engine- Specified by:
getRootScopein interfaceIReportEngine- Returns:
-
changeLogLevel
Change the log level to newLevel- Specified by:
changeLogLevelin interfaceIReportEngine- Parameters:
newLevel- - new log level
-
getConfig
returns the engine configuration object- Specified by:
getConfigin interfaceIReportEngine- Returns:
- the engine configuration object
-
openReportDesign
opens a report design file and creates a report design runnable. From the ReportRunnable object, embedded images and parameter definitions can be retrieved. Constructing an engine task requires a report design runnable object.- Specified by:
openReportDesignin interfaceIReportEngine- Parameters:
designName- the full path of the report design file- Returns:
- a report design runnable object
- Throws:
EngineException- throwed when the input file does not exist, or the file is invalid
-
openReportDesign
public IReportRunnable openReportDesign(org.eclipse.birt.report.model.api.ReportDesignHandle designHandle) throws EngineException opens a report designHandle and creates a report design runnable. From the ReportRunnable object, embedded images and parameter definitions can be retrieved. Constructing an engine task requires a report design runnable object.- Specified by:
openReportDesignin interfaceIReportEngine- Parameters:
designHandle-- Returns:
- a report design runnable object
- Throws:
EngineException
-
openReportDesign
opens a report design stream and creates a report design runnable. From the ReportRunnable object, embedded images and parameter definitions can be retrieved. Constructing an engine task requires a report design runnableobject.- Specified by:
openReportDesignin interfaceIReportEngine- Parameters:
designStream- the report design input stream- Returns:
- a report design runnable object
- Throws:
EngineException- throwed when the input stream is null, or the stream does not yield a valid report design
-
openReportDesign
public IReportRunnable openReportDesign(String name, InputStream designStream) throws EngineException opens a report design stream and creates a report design runnable. From the ReportRunnable object, embedded images and parameter definitions can be retrieved. Constructing an engine task requires a report design runnable object.- Specified by:
openReportDesignin interfaceIReportEngine- Parameters:
name- system id of the report designdesignStream- input stream of the report design- Returns:
- a report design runnable object
- Throws:
EngineException- throwed when the input stream is null, or the stream does not yield a valid report design
-
createRunAndRenderTask
creates an engine task for running and rendering report directly to output format- Specified by:
createRunAndRenderTaskin interfaceIReportEngine- Parameters:
reportRunnable- the runnable report design object- Returns:
- a run and render report task
-
createGetParameterDefinitionTask
creates an engine task for obtaining report parameter definitions- Specified by:
createGetParameterDefinitionTaskin interfaceIReportEngine- Parameters:
reportRunnable- the runnable report design object- Returns:
- a run and render report task
-
createGetParameterDefinitionTask
creates an engine task for obtaining report parameter definitions- Specified by:
createGetParameterDefinitionTaskin interfaceIReportEngine- Parameters:
reportRunnable- the runnable report design object- Returns:
- a GetParameterDefinitionTask
-
getSupportedFormats
returns all supported output formats through BIRT engine emitter extensions- Specified by:
getSupportedFormatsin interfaceIReportEngine- Returns:
- all supported output formats through BIRT engine emitter extensions
-
getEmitterInfo
Return all the emitter information which BIRT Engine can load.- Specified by:
getEmitterInfoin interfaceIReportEngine- Returns:
- the emitter information
-
getMIMEType
the MIME type for the specific formatted supported by the extension.- Specified by:
getMIMETypein interfaceIReportEngine- Parameters:
format- the output formatextensionID- the extension ID, which could be null if only one plugin supports the output format- Returns:
- the MIME type for the specific formatted supported by the extension.
-
destroy
public void destroy()shuts down the report engine- Specified by:
destroyin interfaceIReportEngine
-
createRunTask
creates a task to run a report to generate a report document- Specified by:
createRunTaskin interfaceIReportEngine- Parameters:
reportRunnable- the runnable report design object- Returns:
- a task that runs the report
-
createRenderTask
creates a task that renders the report to a specific output format.- Specified by:
createRenderTaskin interfaceIReportEngine- Parameters:
reportDocument- a handle to an IReportDocument object- Returns:
- a task that renders a report to an output format
-
openReportDocument
opens a report document and returns an IReportDocument object, from which further information can be retrieved.- Specified by:
openReportDocumentin interfaceIReportEngine- Parameters:
fileName- the report document name. report document is an archive in BIRT.- Returns:
- A handle to the report document
- Throws:
EngineException- throwed when the report document archive does not exist, or the file is not a valud report document
-
createDataExtractionTask
creates a task that allows data extraction from a report document- Specified by:
createDataExtractionTaskin interfaceIReportEngine- Parameters:
reportDocument- a handle to an IReportDocument object- Returns:
- a task that renders a report to an output format
-
shutdown
Deprecated.shut down the engine, release all the resources.- Specified by:
shutdownin interfaceIReportEngine
-
openReportDocument
opens a report document and returns an IReportDocument object, from which further information can be retrieved.- Specified by:
openReportDocumentin interfaceIReportEngine- Parameters:
systemId- the system id the opend document. It is used to access the resources with relative path in the report document. If it is NULL, a saved one is used.fileName- the report document name. report document is an archive in BIRT.- Returns:
- A handle to the report document
- Throws:
EngineException- throwed when the report document archive does not exist, or the file is not a valid report document
-
openReportDesign
public IReportRunnable openReportDesign(String designName, org.eclipse.birt.report.model.api.IResourceLocator locator) throws EngineException opens a report design file and creates a report design runnable. From the ReportRunnable object, embedded images and parameter definitions can be retrieved. Constructing an engine task requires a report design runnable object.- Specified by:
openReportDesignin interfaceIReportEngine- Parameters:
designName- the full path of the report design filelocator- the resource locator used to locate files referenced in the design- Returns:
- a report design runnable object
- Throws:
EngineException- throwed when the input file does not exist, or the file is invalid
-
openReportDesign
public IReportRunnable openReportDesign(String name, InputStream designStream, org.eclipse.birt.report.model.api.IResourceLocator locator) throws EngineException opens a report design stream and creates a report design runnable. From the ReportRunnable object, embedded images and parameter definitions can be retrieved. Constructing an engine task requires a report design runnable object.- Specified by:
openReportDesignin interfaceIReportEngine- Parameters:
name- system id of the report designdesignStream- input stream of the report designlocator- the resource locator used to locate files referenced in the design- Returns:
- a report design runnable object
- Throws:
EngineException- throwed when the input stream is null, or the stream does not yield a valid report design
-
openReportDesign
public IReportRunnable openReportDesign(String name, InputStream designStream, Map options) throws EngineException open the report design and return the runnable- Specified by:
openReportDesignin interfaceIReportEngine- Parameters:
name- system id of the report design.designStream- input stream of the report desgin.options- options used to parse the design.- Returns:
- a report design runnable object
- Throws:
EngineException- See Also:
-
ModelOptions
-
openReportDocument
public IReportDocument openReportDocument(String fileName, org.eclipse.birt.report.model.api.IResourceLocator locator) throws EngineException opens a report document and returns an IReportDocument object, from which further information can be retrieved.- Specified by:
openReportDocumentin interfaceIReportEngine- Parameters:
fileName- the report document name. report document is an archive in BIRT.locator- the resource locator used to locate files referenced in the design- Returns:
- A handle to the report document
- Throws:
EngineException- throwed when the report document archive does not exist, or the file is not a valud report document
-
openReportDocument
public IReportDocument openReportDocument(String systemId, String fileName, org.eclipse.birt.report.model.api.IResourceLocator locator) throws EngineException opens a report document and returns an IReportDocument object, from which further information can be retrieved.- Specified by:
openReportDocumentin interfaceIReportEngine- Parameters:
systemId- the system id the opend document. It is used to access the resources with relative path in the report document. If it is NULL, a saved one is used.fileName- the report document name. report document is an archive in BIRT.locator- the resource locator used to locate files referenced in the design- Returns:
- A handle to the report document
- Throws:
EngineException- throwed when the report document archive does not exist, or the file is not a valud report document
-
openReportDocument
public IReportDocument openReportDocument(String systemId, String fileName, Map options) throws EngineException opens a report document and returns an IReportDocument object, from which further information can be retrieved.- Specified by:
openReportDocumentin interfaceIReportEngine- Parameters:
systemId- the system id the opend document. It is used to access the resources with relative path in the report document. If it is NULL, a saved one is used.fileName- the report document name. report document is an archive in BIRT.options- Map defines the options used to parse the design file.- Returns:
- A handle to the report document
- Throws:
EngineException- throwed when the report document archive does not exist, or the file is not a valid report document
-
openReportDocument
public IReportDocument openReportDocument(String systemId, org.eclipse.birt.core.archive.IDocArchiveReader reader, Map options) throws EngineException opens a report document and returns an IReportDocument object, from which further information can be retrieved.- Specified by:
openReportDocumentin interfaceIReportEngine- Parameters:
systemId- the system id the opend document. It is used to access the resources with relative path in the report document. If it is NULL, a saved one is used.reader- a report archive for readingoptions- Map defines the options used to parse the design file.- Returns:
- A handle to the report document
- Throws:
EngineException- throwed when the report document archive does not exist, or the file is not a valid report document
-
getLogger
get the logger used by report engine- Specified by:
getLoggerin interfaceIReportEngine- Returns:
- the logger used by the report engine
-
setLogger
set the logger used by report engine.- Specified by:
setLoggerin interfaceIReportEngine- Parameters:
logger-
-
createRenderTask
create a task that renders the report to a specific output format.- Specified by:
createRenderTaskin interfaceIReportEngine- Parameters:
reportDocument- a handle to an IReportDocument objectreportRunnable- the runnable report design object- Returns:
- a task that renders a report to an output format
-
getDataExtractionFormatInfo
Returns data extraction extension information.- Specified by:
getDataExtractionFormatInfoin interfaceIReportEngine- Returns:
- the data extraction extension information
-
openDocumentWriter
public IDocumentWriter openDocumentWriter(org.eclipse.birt.core.archive.compound.IArchiveFile file) throws EngineException creates a document writer that can write this archive file- Specified by:
openDocumentWriterin interfaceIReportEngine- Parameters:
file- the archive file- Returns:
- a document writer of this archive file
- Throws:
EngineException
-
getVersion
get the BIRT version- Specified by:
getVersionin interfaceIReportEngine- Returns:
- the version of BIRT
-
createEngineTask
Description copied from interface:IReportEnginecreate an engine task- Specified by:
createEngineTaskin interfaceIReportEngine- Parameters:
taskName- the extension name to identify a task- Returns:
- an engine task
- Throws:
EngineException
-
createDatasetPreviewTask
- Specified by:
createDatasetPreviewTaskin interfaceIReportEngine- Throws:
EngineException
-