Decision Center API

ilog.rules.teamserver.model.reporting
Class IlrReportEngine

java.lang.Object
  extended by ilog.rules.teamserver.model.reporting.IlrReportEngine

public class IlrReportEngine
extends Object

Use IlrReportEngine 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:

If you specify both a 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.

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 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");
 

See Also:
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

IlrReportEngine

public IlrReportEngine()
Creates a report engine.

Method Detail

setReportOuputFilepath

public void setReportOuputFilepath(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(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,
                   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

Decision Center API

© Copyright IBM Corp. 1987, 2013