public class IlrReportEngine
extends java.lang.Object
IlrReportEngine to generate reports.
The minimum requirement for report generation is to specify the file the report is written to. To do this, call either:
setReportOuputWriter(Writer) to use a
Writer.setReportOuputFilepath(String) to write to a
file.Writer and a file path, the
Writer is ignored.
To generate a report from a Java application, call
setReportOuputFilepath(String). The base folder is
computed by removing the filename from the given path.
This method also creates the folders used to store the resources necessary
to display the report off-line. This includes the images folder
that is used to store elements such as decision trees or ruleflows that are
represented by an image.
To customize report filtering and sorting, pass the following classes to
the IlrReportContext.
IlrReportSorter for sorting.
IlrReportFilter for filtering.
The following code example shows how to generate the standard report used by Decision Center:
// Creates report engine.
IlrReportEngine reportEngine = new IlrReportEngine();
// Creates a context with a session to use during the generation of the report.
IlrReportContext reportCtx = new IlrReportContext(session);
// Sets a sorter as the one used in Decision Center.
reportCtx.setReportSorter(new IlrDefaultReportSorter());
// Sets a filter as the one used in Decision Center.
reportCtx.setReportFilter(new IlrDefaultReportFilter());
// Specifies the output target.
reportEngine.setReportOuputFilepath("c:\\reports\\myReport.html");
// Runs the report.
reportEngine.report(reportCtx, elementDetails);
By default, the URL of the CSS used in the report is computed from the session
passed to the IlrReportContext.
To specify your own CSS file, set the
IlrRuntimeConstants.REPORT_CSS_PATH property.
The following code example shows how to do this:
IlrReportContext reportCtx = new IlrReportContext(session);
reportCtx.addProperty(IlrRuntimeConstants.REPORT_CSS_PATH, "myCSSFile");
| Constructor and Description |
|---|
IlrReportEngine()
Creates a report engine.
|
| Modifier and Type | Method and Description |
|---|---|
void |
report(IlrReportContext reportContext,
java.util.List<IlrElementDetails> elements)
A call to this method triggers a report.
|
void |
setReportOuputFilepath(java.lang.String reportOuputFilepath)
Specifies the path to the file in which to write the report.
|
void |
setReportOuputWriter(java.io.Writer reportOuputWriter)
Specifies the writer in which to write the report.
|
public void setReportOuputFilepath(java.lang.String reportOuputFilepath)
reportOuputFilepath - The path to a file.setReportOuputWriter(Writer)public void setReportOuputWriter(java.io.Writer reportOuputWriter)
reportOuputWriter - A writer.setReportOuputWriter(Writer)public void report(IlrReportContext reportContext, java.util.List<IlrElementDetails> elements) throws ilog.rules.teamserver.model.reporting.IlrReportingException
ilog.rules.teamserver.model.reporting.IlrReportingExceptionreportContext - The context in which the report is executed.elements - A list of element details to report.IlrReportContext© Copyright IBM Corp. 1987, 2017