|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.teamserver.model.reporting.IlrReportEngine
public class IlrReportEngine
Use 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");
setReportOuputWriter(Writer)
,
setReportOuputFilepath(String)
,
IlrReportContext
,
IlrReportFilter
,
IlrReportSorter
Constructor Summary | |
---|---|
IlrReportEngine()
Creates a report engine. |
Method Summary | |
---|---|
void |
report(IlrReportContext reportContext,
List<IlrElementDetails> elements)
A call to this method triggers a report. |
void |
setReportOuputFilepath(String reportOuputFilepath)
Specifies the path to the file in which to write the report. |
void |
setReportOuputWriter(Writer reportOuputWriter)
Specifies the writer in which to write the report. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IlrReportEngine()
Method Detail |
---|
public void setReportOuputFilepath(String reportOuputFilepath)
reportOuputFilepath
- The path to a file.setReportOuputWriter(Writer)
public void setReportOuputWriter(Writer reportOuputWriter)
reportOuputWriter
- A writer.setReportOuputWriter(Writer)
public void report(IlrReportContext reportContext, List<IlrElementDetails> elements) throws ilog.rules.teamserver.model.reporting.IlrReportingException
ilog.rules.teamserver.model.reporting.IlrReportingException
reportContext
- The context in which the report is executed.elements
- A list of element details to report.IlrReportContext
|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |