Class IlrReportEngine
- java.lang.Object
-
- ilog.rules.teamserver.model.reporting.IlrReportEngine
-
public class IlrReportEngine extends java.lang.Object
UseIlrReportEngine
to generate reports.Overview
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 aWriter
.setReportOuputFilepath(String)
to write to a file.
Writer
and a file path, theWriter
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.
Code examples
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 theIlrReportContext
. To specify your own CSS file, set theIlrRuntimeConstants.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 Summary
Constructors Constructor and Description IlrReportEngine()
Creates a report engine.
-
Method Summary
Methods 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.
-
-
-
Method Detail
-
setReportOuputFilepath
public void setReportOuputFilepath(java.lang.String reportOuputFilepath)
Specifies the path to the file in which to write the report.- Parameters:
reportOuputFilepath
- The path to a file.- See Also:
setReportOuputWriter(Writer)
-
setReportOuputWriter
public void setReportOuputWriter(java.io.Writer reportOuputWriter)
Specifies the writer in which to write the report.- Parameters:
reportOuputWriter
- A writer.- See Also:
setReportOuputWriter(Writer)
-
report
public void report(IlrReportContext reportContext, java.util.List<IlrElementDetails> elements) throws ilog.rules.teamserver.model.reporting.IlrReportingException
A call to this method triggers a report.- Throws:
ilog.rules.teamserver.model.reporting.IlrReportingException
- Parameters:
reportContext
- The context in which the report is executed.elements
- A list of element details to report.- See Also:
IlrReportContext
-
-